2013-10-02 11:07:30

by Ramkumar Ramachandra

[permalink] [raw]
Subject: [BUG] perf timechart segfault

Hi,

I tried using the `perf timechart` command after a `sudo perf
timechart record -- git status`, and it segfaulted. Backtrace follows:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x000000000047d728 in perf_session_deliver_event
(session=session@entry=0x8ea450, event=event@entry=0x7ffff7f13f98,
sample=sample@entry=0x7fffffffd530,
tool=tool@entry=0x7fffffffd7a0, file_offset=file_offset@entry=8088)
at util/session.c:1006
#2 0x000000000047faec in perf_session__process_event
(file_offset=8088, tool=0x7fffffffd7a0, event=0x7ffff7f13f98,
session=0x8ea450) at util/session.c:1098
#3 __perf_session__process_events (session=session@entry=0x8ea450,
data_offset=<optimized out>,
data_size=<optimized out>, file_size=635384,
tool=tool@entry=0x7fffffffd7a0) at util/session.c:1360
#4 0x000000000047ff81 in perf_session__process_events
(self=self@entry=0x8ea450, tool=tool@entry=0x7fffffffd7a0)
at util/session.c:1403
#5 0x000000000042f12a in __cmd_timechart (output_name=0x4ee399
"output.svg") at builtin-timechart.c:1009
#6 cmd_timechart (argc=0, argv=0x7fffffffdf20, prefix=<optimized
out>) at builtin-timechart.c:1116
#7 0x0000000000419925 in run_builtin (p=p@entry=0x725f90
<commands+240>, argc=argc@entry=1,
argv=argv@entry=0x7fffffffdf20) at perf.c:319
#8 0x0000000000419199 in handle_internal_command
(argv=0x7fffffffdf20, argc=1) at perf.c:376
#9 run_argv (argv=0x7fffffffdd20, argcp=0x7fffffffdd2c) at perf.c:420
#10 main (argc=1, argv=0x7fffffffdf20) at perf.c:521

I compiled it with EXTRA_CFLAGS="-O0 -g", so all the debugging symbols
should be available. Not sure what's going on, or why I needed sudo to
record data in the first place.

Any hints?


2013-10-02 11:20:22

by Jiri Olsa

[permalink] [raw]
Subject: Re: [BUG] perf timechart segfault

On Wed, Oct 02, 2013 at 04:36:45PM +0530, Ramkumar Ramachandra wrote:
> Hi,
>
> I tried using the `perf timechart` command after a `sudo perf
> timechart record -- git status`, and it segfaulted. Backtrace follows:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000000000 in ?? ()
> (gdb) bt
> #0 0x0000000000000000 in ?? ()
> #1 0x000000000047d728 in perf_session_deliver_event
> (session=session@entry=0x8ea450, event=event@entry=0x7ffff7f13f98,
> sample=sample@entry=0x7fffffffd530,
> tool=tool@entry=0x7fffffffd7a0, file_offset=file_offset@entry=8088)
> at util/session.c:1006
> #2 0x000000000047faec in perf_session__process_event
> (file_offset=8088, tool=0x7fffffffd7a0, event=0x7ffff7f13f98,
> session=0x8ea450) at util/session.c:1098
> #3 __perf_session__process_events (session=session@entry=0x8ea450,
> data_offset=<optimized out>,
> data_size=<optimized out>, file_size=635384,
> tool=tool@entry=0x7fffffffd7a0) at util/session.c:1360
> #4 0x000000000047ff81 in perf_session__process_events
> (self=self@entry=0x8ea450, tool=tool@entry=0x7fffffffd7a0)
> at util/session.c:1403
> #5 0x000000000042f12a in __cmd_timechart (output_name=0x4ee399
> "output.svg") at builtin-timechart.c:1009
> #6 cmd_timechart (argc=0, argv=0x7fffffffdf20, prefix=<optimized
> out>) at builtin-timechart.c:1116
> #7 0x0000000000419925 in run_builtin (p=p@entry=0x725f90
> <commands+240>, argc=argc@entry=1,
> argv=argv@entry=0x7fffffffdf20) at perf.c:319
> #8 0x0000000000419199 in handle_internal_command
> (argv=0x7fffffffdf20, argc=1) at perf.c:376
> #9 run_argv (argv=0x7fffffffdd20, argcp=0x7fffffffdd2c) at perf.c:420
> #10 main (argc=1, argv=0x7fffffffdf20) at perf.c:521
>
> I compiled it with EXTRA_CFLAGS="-O0 -g", so all the debugging symbols
> should be available. Not sure what's going on, or why I needed sudo to
> record data in the first place.

hi,
what perf version are you running? I can't hit the issue
and also the file lines in backtrace indicate it's not
current one.

thanks,
jirka

2013-10-02 11:34:30

by Ramkumar Ramachandra

[permalink] [raw]
Subject: Re: [BUG] perf timechart segfault

Hi Jiri,

Jiri Olsa wrote:
> what perf version are you running?

I'm running off the one in torvalds/linux.git.

$ perf --version
perf version 3.12.rc3.g34b22d5

The log of builtin-timechart.c shows that it was last touched by you
three months ago: 5936678 (perf timechart: Remove event types
framework only user, 2013-07-11). Are there some patches awaiting
merge that I'm missing?

2013-10-02 11:59:49

by Jiri Olsa

[permalink] [raw]
Subject: Re: [BUG] perf timechart segfault

On Wed, Oct 02, 2013 at 05:03:48PM +0530, Ramkumar Ramachandra wrote:
> Hi Jiri,
>
> Jiri Olsa wrote:
> > what perf version are you running?
>
> I'm running off the one in torvalds/linux.git.
>
> $ perf --version
> perf version 3.12.rc3.g34b22d5
>
> The log of builtin-timechart.c shows that it was last touched by you
> three months ago: 5936678 (perf timechart: Remove event types
> framework only user, 2013-07-11). Are there some patches awaiting
> merge that I'm missing?

looks like you're missing this one:
(git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core)

perf tools: Add default handler for mmap2 events
commit e0e3e2d9a522b2230d395922fde9c6ea928ae7f8
Author: David Ahern <[email protected]>
Date: Sun Sep 22 19:44:59 2013 -0600

Not sure if this one plus some other MMAP2 David's fixies
are on its way up, but if not I guess Arnaldo's planning
to push them out eventually ;-)

jirka

2013-10-02 12:13:55

by Ingo Molnar

[permalink] [raw]
Subject: Re: [BUG] perf timechart segfault


* Jiri Olsa <[email protected]> wrote:

> On Wed, Oct 02, 2013 at 05:03:48PM +0530, Ramkumar Ramachandra wrote:
> > Hi Jiri,
> >
> > Jiri Olsa wrote:
> > > what perf version are you running?
> >
> > I'm running off the one in torvalds/linux.git.
> >
> > $ perf --version
> > perf version 3.12.rc3.g34b22d5
> >
> > The log of builtin-timechart.c shows that it was last touched by you
> > three months ago: 5936678 (perf timechart: Remove event types
> > framework only user, 2013-07-11). Are there some patches awaiting
> > merge that I'm missing?
>
> looks like you're missing this one:
> (git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core)
>
> perf tools: Add default handler for mmap2 events
> commit e0e3e2d9a522b2230d395922fde9c6ea928ae7f8
> Author: David Ahern <[email protected]>
> Date: Sun Sep 22 19:44:59 2013 -0600
>
> Not sure if this one plus some other MMAP2 David's fixies
> are on its way up, but if not I guess Arnaldo's planning
> to push them out eventually ;-)

Would be nice to get those fixes into perf/urgent ASAP.

Thanks,

Ingo

2013-10-02 13:11:10

by Ramkumar Ramachandra

[permalink] [raw]
Subject: Re: [BUG] perf timechart segfault

Jiri Olsa wrote:
> looks like you're missing this one:
> (git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core)

Very messy; doesn't rebase on top of the latest torvalds/linux.git
cleanly: I get a merge conflict at patch 9 of 74. Since my work is
based on torvalds/linux.git, I was hoping to rebase it on top of
Arnaldo's tree, but that results in conflicts too: I'm resolving them
now.

Are the merge windows always this large? Why isn't Arnaldo's tree
listed in MAINTAINERS?

2013-10-02 13:26:37

by Ingo Molnar

[permalink] [raw]
Subject: Re: [BUG] perf timechart segfault


* Ramkumar Ramachandra <[email protected]> wrote:

> Jiri Olsa wrote:
> > looks like you're missing this one:
> > (git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core)
>
> Very messy; doesn't rebase on top of the latest torvalds/linux.git
> cleanly: I get a merge conflict at patch 9 of 74. Since my work is based
> on torvalds/linux.git, I was hoping to rebase it on top of Arnaldo's
> tree, but that results in conflicts too: I'm resolving them now.
>
> Are the merge windows always this large? Why isn't Arnaldo's tree listed
> in MAINTAINERS?

note that it's Arnaldo's development tree, not a tree to generally base
pull requests on - that is what tip:perf/core is for.

Thanks,

Ingo

2013-10-02 15:33:17

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [BUG] perf timechart segfault

Em Wed, Oct 02, 2013 at 02:13:46PM +0200, Ingo Molnar escreveu:
> * Jiri Olsa <[email protected]> wrote:
> > On Wed, Oct 02, 2013 at 05:03:48PM +0530, Ramkumar Ramachandra wrote:
> > > Jiri Olsa wrote:
> > > The log of builtin-timechart.c shows that it was last touched by you
> > > three months ago: 5936678 (perf timechart: Remove event types
> > > framework only user, 2013-07-11). Are there some patches awaiting
> > > merge that I'm missing?

> > looks like you're missing this one:
> > (git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core)

> > perf tools: Add default handler for mmap2 events
> > commit e0e3e2d9a522b2230d395922fde9c6ea928ae7f8
> > Author: David Ahern <[email protected]>

> > Not sure if this one plus some other MMAP2 David's fixies
> > are on its way up, but if not I guess Arnaldo's planning
> > to push them out eventually ;-)

> Would be nice to get those fixes into perf/urgent ASAP.

Will get a new perf/urgent batch ready today, thanks for pointing those
out.

- Arnaldo

2013-10-02 16:12:51

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [BUG] perf timechart segfault

Em Wed, Oct 02, 2013 at 01:59:36PM +0200, Jiri Olsa escreveu:
> On Wed, Oct 02, 2013 at 05:03:48PM +0530, Ramkumar Ramachandra wrote:
> > Jiri Olsa wrote:
> > > what perf version are you running?

> > I'm running off the one in torvalds/linux.git.

> > $ perf --version
> > perf version 3.12.rc3.g34b22d5

> > The log of builtin-timechart.c shows that it was last touched by you
> > three months ago: 5936678 (perf timechart: Remove event types
> > framework only user, 2013-07-11). Are there some patches awaiting
> > merge that I'm missing?

> looks like you're missing this one:
> (git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core)

> perf tools: Add default handler for mmap2 events
> commit e0e3e2d9a522b2230d395922fde9c6ea928ae7f8
> Author: David Ahern <[email protected]>
> Date: Sun Sep 22 19:44:59 2013 -0600
>
> Not sure if this one plus some other MMAP2 David's fixies

The other is already in -rc:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/tools/perf/builtin-trace.c?id=384c671e33a7ddf905f2c60b433b9883f0e5a605

> are on its way up, but if not I guess Arnaldo's planning
> to push them out eventually ;-)

I thought this one wouldn't be needed for perf/urgent, but it is,
just cherry picked it there, will push.

- Arnaldo