lkml.org 
[lkml]   [2015]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [BUG] perf script segfault
Em Mon, Mar 30, 2015 at 04:51:34PM -0600, David Ahern escreveu:
> Surprised Stephane has not hit this one yet:
>
> $ perf record -e <any-event> -a | perf script
> Segmentation fault (core dumped)
>
> It's the second one that core dumps.
>
> $ gdb perf core.16704
> ...
> [New LWP 16704]
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> Core was generated by `/tmp/perf/perf script'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0 perf_tool__fill_defaults (tool=tool@entry=0x0) at util/session.c:259
> 259 if (tool->sample == NULL)
> ...
> (gdb) bt
> #0 perf_tool__fill_defaults (tool=tool@entry=0x0) at util/session.c:259
> #1 0x00000000004a5baa in __perf_session__process_pipe_events
> (session=0x2178b80) at util/session.c:1178
> #2 perf_session__process_events (session=0x2178b80) at util/session.c:1416
> #3 0x000000000043c5dc in __cmd_script (script=0x7fffc7a4d840) at
> builtin-script.c:803
> #4 cmd_script (argc=<optimized out>, argv=<optimized out>,
> prefix=<optimized out>) at builtin-script.c:1840
> ...
>
> tool was moved to ordered_events and is not initialized for pipe mode. I
> don't have time to look into it more than that before PTO on Wednesday.

I guess this one is enough, no? Checking with your example...


diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index adf0740c563b..f0c8dc519db0 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -139,6 +139,7 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) {
dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n");
tool->ordered_events = false;
+ session->ordered_events.tool = tool;
} else {
ordered_events__init(&session->ordered_events, &session->machines,
session->evlist, tool, ordered_events__deliver_event);

\
 
 \ /
  Last update: 2015-03-31 02:21    [W:0.818 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site