public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: David Ahern <dsahern@gmail.com>
Cc: Stephane Eranian <eranian@google.com>,
	Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] perf script segfault
Date: Mon, 30 Mar 2015 20:45:33 -0300	[thread overview]
Message-ID: <20150330234533.GA9438@kernel.org> (raw)
In-Reply-To: <5519D376.6010509@gmail.com>

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);

  reply	other threads:[~2015-03-30 23:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 22:51 [BUG] perf script segfault David Ahern
2015-03-30 23:45 ` Arnaldo Carvalho de Melo [this message]
2015-03-31 12:59   ` Arnaldo Carvalho de Melo
2015-03-31 13:36     ` David Ahern
2015-04-07 23:41       ` David Ahern
2015-04-07 23:49         ` David Ahern
2015-03-31 13:58     ` Jiri Olsa
2015-03-31 14:02       ` Arnaldo Carvalho de Melo
2015-03-31 14:13         ` Arnaldo Carvalho de Melo
2015-03-31 14:25           ` Jiri Olsa
2015-03-31 14:37             ` Arnaldo Carvalho de Melo
2015-03-31 14:57               ` Arnaldo Carvalho de Melo
2015-03-31 15:48                 ` Jiri Olsa
2015-03-31 15:50                   ` Jiri Olsa
2015-03-31 16:14                     ` Arnaldo Carvalho de Melo
2015-03-31 16:17                       ` Arnaldo Carvalho de Melo
2015-03-31 16:26                       ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150330234533.GA9438@kernel.org \
    --to=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox