Re: [PATCH] perf ordered_events: fix crash in free_dup_event()

2018-08-09 Thread Jiri Olsa
On Wed, Aug 08, 2018 at 02:47:42PM -0700, Stephane Eranian wrote: > Hi, > > Ok, I found the problem. It still exists upstream , just very tricky to > trigger. > Took me lots of time with gdb + watchpoints to track this down, where > in fact it was just in front of me. > > From the crashdump: >

Re: [PATCH] perf ordered_events: fix crash in free_dup_event()

2018-08-08 Thread Stephane Eranian
Hi, Ok, I found the problem. It still exists upstream , just very tricky to trigger. Took me lots of time with gdb + watchpoints to track this down, where in fact it was just in front of me. >From the crashdump: Program received signal SIGSEGV, Segmentation fault. free_dup_event (oe=0x26a39a0

Re: [PATCH] perf ordered_events: fix crash in free_dup_event()

2018-08-08 Thread Jiri Olsa
On Tue, Aug 07, 2018 at 12:11:05PM -0700, Stephane Eranian wrote: > Jiri, > On Tue, Aug 7, 2018 at 1:50 AM Jiri Olsa wrote: > > > > On Tue, Aug 07, 2018 at 01:16:22AM -0700, Stephane Eranian wrote: > > > On Tue, Aug 7, 2018 at 12:20 AM Jiri Olsa wrote: > > > > > > > > On Mon, Aug 06, 2018 at 06:2

Re: [PATCH] perf ordered_events: fix crash in free_dup_event()

2018-08-07 Thread Stephane Eranian
Jiri, On Tue, Aug 7, 2018 at 1:50 AM Jiri Olsa wrote: > > On Tue, Aug 07, 2018 at 01:16:22AM -0700, Stephane Eranian wrote: > > On Tue, Aug 7, 2018 at 12:20 AM Jiri Olsa wrote: > > > > > > On Mon, Aug 06, 2018 at 06:23:35PM -0700, Stephane Eranian wrote: > > > > Depending on memory allocations, i

Re: [PATCH] perf ordered_events: fix crash in free_dup_event()

2018-08-07 Thread Jiri Olsa
On Tue, Aug 07, 2018 at 01:16:22AM -0700, Stephane Eranian wrote: > On Tue, Aug 7, 2018 at 12:20 AM Jiri Olsa wrote: > > > > On Mon, Aug 06, 2018 at 06:23:35PM -0700, Stephane Eranian wrote: > > > Depending on memory allocations, it was possible to get a SEGFAULT in > > > free_dup_event() because

Re: [PATCH] perf ordered_events: fix crash in free_dup_event()

2018-08-07 Thread Stephane Eranian
On Tue, Aug 7, 2018 at 12:20 AM Jiri Olsa wrote: > > On Mon, Aug 06, 2018 at 06:23:35PM -0700, Stephane Eranian wrote: > > Depending on memory allocations, it was possible to get a SEGFAULT in > > free_dup_event() because the event pointer was bogus: > > > > perf[1354]: segfault at 000

Re: [PATCH] perf ordered_events: fix crash in free_dup_event()

2018-08-07 Thread Jiri Olsa
On Mon, Aug 06, 2018 at 06:23:35PM -0700, Stephane Eranian wrote: > Depending on memory allocations, it was possible to get a SEGFAULT in > free_dup_event() because the event pointer was bogus: > > perf[1354]: segfault at 0006 ip 004b7fc7 is there any reproducer? > > Initial

[PATCH] perf ordered_events: fix crash in free_dup_event()

2018-08-06 Thread Stephane Eranian
Depending on memory allocations, it was possible to get a SEGFAULT in free_dup_event() because the event pointer was bogus: perf[1354]: segfault at 0006 ip 004b7fc7 Initially, I thought it was some double free. But it turns out it looked more like a buffer overrun. Adding padd