All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] perf top -G is broken
@ 2012-05-02  2:50 Namhyung Kim
  2012-05-02 16:02 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: Namhyung Kim @ 2012-05-02  2:50 UTC (permalink / raw)
  To: linux-perf-users; +Cc: Arnaldo Carvalho de Melo


Hi,

Some guy reported me that perf top -G is broken with segment fault. I
can reproduce it on my system easily but the time is vary - few seconds
to 30 minutes. I ran it with --stdio to get a core file:

$ sudo ./perf top -G --stdio > /dev/null
[sudo] password for namhyung: 
Failed to open /tmp/perf-1313.map, continuing without symbols
Warning: empty node in callchain tree
Warning: empty node in callchain tree
/usr/lib64/libgvfscommon.so.0.0.0.#prelink#.SjIuuf was updated (is prelink enabled?). Restart the long running apps that use it!
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
no symbols found in /usr/sbin/iscsid, maybe install a debug package?
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree
Warning: empty node in callchain tree


It seems there's a callchain problem. gdb bracktrace told me:

$ gdb -q ./perf core.4513 
Reading symbols from /home/namhyung/project/linux/tools/perf/perf...done.
[New LWP 4514]
[New LWP 4513]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./perf top -G --stdio'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000004594ba in callchain_cursor_advance (cursor=<optimized out>) at util/callchain.h:141
141		cursor->curr = cursor->curr->next;
Missing separate debuginfos, use: <SNIP>

(gdb) bt
#0  0x00000000004594ba in callchain_cursor_advance (cursor=<optimized out>) at util/callchain.h:141
#1  fill_node (cursor=0x19ad6f8, node=0x7f8208697df0) at util/callchain.c:226
#2  add_child (period=1198958, cursor=0x19ad6f8, parent=0x21197c0) at util/callchain.c:239
#3  append_chain_children (root=root@entry=0x21197c0, cursor=cursor@entry=0x19ad6f8, period=period@entry=1198958)
    at util/callchain.c:308
#4  0x000000000045951f in append_chain (period=1198958, cursor=0x19ad6f8, root=0x21197c0) at util/callchain.c:374
#5  append_chain_children (root=root@entry=0x1a25f90, cursor=cursor@entry=0x19ad6f8, period=1198958) at util/callchain.c:302
#6  0x0000000000459a33 in merge_chain_branch (cursor=cursor@entry=0x19ad6f8, dst=dst@entry=0x1a25f90, src=src@entry=0x28c3240)
    at util/callchain.c:415
#7  0x000000000045999a in merge_chain_branch (cursor=cursor@entry=0x19ad6f8, dst=dst@entry=0x1a25f90, src=src@entry=0x29e7480)
    at util/callchain.c:419
#8  0x000000000045a274 in callchain_merge (cursor=cursor@entry=0x19ad6f8, dst=dst@entry=0x1a25f88, src=src@entry=0x29e7478)
    at util/callchain.c:436
#9  0x00000000004776fe in hists__collapse_insert_entry (he=0x29e73d0, root=0x19ad540, hists=0x19ad520) at util/hist.c:401
#10 __hists__collapse_resort (hists=0x19ad520, threaded=threaded@entry=true) at util/hist.c:458
#11 0x00000000004791f1 in hists__collapse_resort_threaded (hists=<optimized out>) at util/hist.c:476
#12 0x0000000000426ad3 in perf_top__print_sym_table (top=0x7fffb70097c0) at builtin-top.c:309
#13 display_thread (arg=0x7fffb70097c0) at builtin-top.c:623
#14 0x0000003275607d14 in start_thread () from /lib64/libpthread.so.0
#15 0x00000032752f194d in clone () from /lib64/libc.so.6

(gdb) p *(struct callchain_cursor *)0x19ad6f8
$1 = {nr = 1, first = 0x1a097a0, last = 0x1a097b8, pos = 1, curr = 0x19c6a90}

I wonder how callchain_cursor_advance() is called in fill_node() when
cursor->pos == cursor->nr. It should be checked at while conditional and
bailed out AFAICS.

Any thought?

Thanks,
Namhyung

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

end of thread, other threads:[~2012-05-05 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-02  2:50 [BUG] perf top -G is broken Namhyung Kim
2012-05-02 16:02 ` Arnaldo Carvalho de Melo
2012-05-04  4:09   ` Namhyung Kim
2012-05-04 21:55     ` David Ahern
2012-05-05 22:42       ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.