linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf segfault in in ordered_events__free()
@ 2019-01-16 18:57 Song Liu
  2019-01-16 21:34 ` Jiri Olsa
  0 siblings, 1 reply; 5+ messages in thread
From: Song Liu @ 2019-01-16 18:57 UTC (permalink / raw)
  To: open list, Jiri Olsa; +Cc: acme

Hi,

We are debugging a segfault of perf in ordered_events__free().
Disassemble shows the segfault was caused by oe->buff == NULL
in the following line:

        /*
         * Current buffer might not have all the events allocated
         * yet, we need to free only allocated ones ...
         */
        list_del(&oe->buffer->list);

After poking around the code, I suspect it is caused by the following
condition in alloc_event():

        } else if (oe->buffer) {
                new = &oe->buffer->event[oe->buffer_idx];
                if (++oe->buffer_idx == MAX_SAMPLE_BUFFER)
                        oe->buffer = NULL;

Does this theory make sense? If so, what would be the best fix?

Thanks in advance!
Song

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

end of thread, other threads:[~2019-01-17  9:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 18:57 perf segfault in in ordered_events__free() Song Liu
2019-01-16 21:34 ` Jiri Olsa
2019-01-16 21:53   ` Song Liu
2019-01-17  7:33     ` Song Liu
2019-01-17  9:18       ` Jiri Olsa

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