linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Fixes: cfc8874a485 ("perf script: Process cpu/threads maps")
@ 2016-03-09  5:11 Chris Phlipot
  2016-03-09  8:02 ` Jiri Olsa
  2016-03-11  8:46 ` [tip:perf/core] perf tools: Fix perf script python database export crash tip-bot for Chris Phlipot
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Phlipot @ 2016-03-09  5:11 UTC (permalink / raw)
  To: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo
  Cc: linux-kernel, Chris Phlipot

fix the perf script python database export crash.
Remove the union in evsel so that the database id and priv pointer can be
used simultainously without conflicting and crashing.

Detailed Description for the fixed bug follows:

perf script crashes with a segmentaiton fault on user space tool version
4.5.rc7.ge2857b when using the python database export API. It works
properly in 4.4 and prior versions.

the crash fist appeared in
cfc8874a485 ("perf script: Process cpu/threads maps")

How to reprodcue the bug:

remove any temporary files left over from a previous crash
(if you have already attemped to reproduce the bug):
$ rm -r test_db-perf-data
$ dropdb test_db

$ ./perf record timeout 1 yes >/dev/null
$ ./perf script -s scripts/python/export-to-postgresql.py test_db

Stack Trace:
Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x1) at malloc.c:2929
2929	malloc.c: No such file or directory.
(gdb) bt
    at util/stat.c:122
    argv=<optimized out>, prefix=<optimized out>) at builtin-script.c:2231
    argc=argc@entry=4, argv=argv@entry=0x7fffffffdf70) at perf.c:390
    at perf.c:451

Signed-off-by: Chris Phlipot <cphlipot0@gmail.com>
---
 tools/perf/util/evsel.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 8e75434..4d8037a 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -93,10 +93,8 @@ struct perf_evsel {
 	const char		*unit;
 	struct event_format	*tp_format;
 	off_t			id_offset;
-	union {
-		void		*priv;
-		u64		db_id;
-	};
+	void			*priv;
+	u64			db_id;
 	struct cgroup_sel	*cgrp;
 	void			*handler;
 	struct cpu_map		*cpus;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-11  8:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-09  5:11 [PATCH 1/1] Fixes: cfc8874a485 ("perf script: Process cpu/threads maps") Chris Phlipot
2016-03-09  8:02 ` Jiri Olsa
2016-03-09 13:35   ` Arnaldo Carvalho de Melo
2016-03-11  8:46 ` [tip:perf/core] perf tools: Fix perf script python database export crash tip-bot for Chris Phlipot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).