Bug 826556 - perf report segfault when using --sort
perf report segfault when using --sort
Status: CLOSED DUPLICATE of bug 846702
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
6.3
Unspecified Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Jiri Olsa
Guangze Bai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-30 09:52 EDT by William Cohen
Modified: 2016-02-10 08:12 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-29 06:38:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description William Cohen 2012-05-30 09:52:38 EDT
Description of problem:

Collecting data for a relatively long run. When trying to analyze with perf report tui using the --sort option it crashes.

Version-Release number of selected component (if applicable):
kernel-2.6.32-220.17.1.el6.x86_64
perf-2.6.32-220.17.1.el6.x86_64

How reproducible:
everytime

Steps to Reproduce:
1. Download a systemtap srpm
2. yum-builddep ../SRPMS/systemtap-*.src.rpm
3. cd ~/rpmbuild/SPECS; perf record rpmbuild -ba systemtap.spec
4. perf report  --sort=comm

  
Actual results:
perf report tui crashes


Expected results:
perf report tui presents data sorted by executable.

Additional info:
from gdb 

$gdb /usr/bin/perf
(gdb) run report --sort=comm

Program received signal SIGSEGV, Segmentation fault.──────────────────────────┘
symbol__inc_addr_samples (sym=0x33f1930, map=<value optimized out>, evidx=0, 
    addr=497632) at util/annotate.c:71
71		h->addr[offset]++;
#0  symbol__inc_addr_samples (sym=0x33f1930, map=<value optimized out>, 
    evidx=0, addr=497632) at util/annotate.c:71
#1  0x00000000004187da in perf_session__add_hist_entry (
    event=<value optimized out>, sample=0x7fffffffdb30, evsel=0x8c4e60, 
    session=0x8c3270) at builtin-report.c:92
#2  process_sample_event (event=<value optimized out>, sample=0x7fffffffdb30, 
    evsel=0x8c4e60, session=0x8c3270) at builtin-report.c:122
#3  0x000000000044bade in flush_sample_queue (session=0x8c3270, 
    data_offset=<value optimized out>, data_size=<value optimized out>, 
    file_size=6942624, ops=0x69efa0) at util/session.c:506
#4  __perf_session__process_events (session=0x8c3270, 
    data_offset=<value optimized out>, data_size=<value optimized out>, 
    file_size=6942624, ops=0x69efa0) at util/session.c:1095
#5  0x0000000000418b4d in __cmd_report (argc=<value optimized out>, 
    argv=<value optimized out>, prefix=<value optimized out>)
    at builtin-report.c:272
#6  cmd_report (argc=<value optimized out>, argv=<value optimized out>, 
    prefix=<value optimized out>) at builtin-report.c:521
#7  0x000000000040e5a9 in run_builtin (p=0x69a048, argc=2, argv=0x7fffffffdef0)
    at perf.c:286
#8  0x000000000040efcc in handle_internal_command (argc=2, argv=0x7fffffffdef0)
    at perf.c:357
#9  run_argv (argc=2, argv=0x7fffffffdef0) at perf.c:401
#10 main (argc=2, argv=0x7fffffffdef0) at perf.c:487

The perf built from the git checkout of the mainstream kernel also seems to suffer from the same problem
Comment 2 William Cohen 2012-05-30 10:20:13 EDT
Ran with valgrind:

valgrind --log-file=/tmp/valgrind.log perf report  --sort=comm 

It show the bogus address being used but doesn't show earlier problems with memory use:

==10515== Memcheck, a memory error detector
==10515== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==10515== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==10515== Command: perf report --sort=comm
==10515== Parent PID: 3586
==10515== 
==10515== Invalid read of size 8
==10515==    at 0x4281E5: symbol__inc_addr_samples (annotate.c:71)
==10515==    by 0x4187D9: process_sample_event (builtin-report.c:92)
==10515==    by 0x44BADD: __perf_session__process_events (session.c:506)
==10515==    by 0x418B4C: cmd_report (builtin-report.c:272)
==10515==    by 0x40E5A8: run_builtin (perf.c:286)
==10515==    by 0x40EFCB: main (perf.c:357)
==10515==  Address 0x408cd9b28 is not stack'd, malloc'd or (recently) free'd
==10515== 
==10515== 
==10515== Process terminating with default action of signal 11 (SIGSEGV)
==10515==  Access not within mapped region at address 0x408CD9B28
==10515==    at 0x4281E5: symbol__inc_addr_samples (annotate.c:71)
==10515==    by 0x4187D9: process_sample_event (builtin-report.c:92)
==10515==    by 0x44BADD: __perf_session__process_events (session.c:506)
==10515==    by 0x418B4C: cmd_report (builtin-report.c:272)
==10515==    by 0x40E5A8: run_builtin (perf.c:286)
==10515==    by 0x40EFCB: main (perf.c:357)
==10515==  If you believe this happened as a result of a stack
==10515==  overflow in your program's main thread (unlikely but
==10515==  possible), you can try to increase the size of the
==10515==  main thread stack using the --main-stacksize= flag.
==10515==  The main thread stack size used in this run was 10485760.
==10515== 
==10515== HEAP SUMMARY:
==10515==     in use at exit: 48,922,474 bytes in 31,808 blocks
==10515==   total heap usage: 32,729 allocs, 921 frees, 52,258,004 bytes allocat
ed
==10515== 
==10515== LEAK SUMMARY:
==10515==    definitely lost: 65 bytes in 1 blocks
==10515==    indirectly lost: 0 bytes in 0 blocks
==10515==      possibly lost: 48,550,168 bytes in 31,423 blocks
==10515==    still reachable: 372,241 bytes in 384 blocks
==10515==         suppressed: 0 bytes in 0 blocks
==10515== Rerun with --leak-check=full to see details of leaked memory
==10515== 
==10515== For counts of detected and suppressed errors, rerun with: -v
==10515== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 6 from 6)
Comment 3 Arnaldo Carvalho de Melo 2012-05-30 10:44:55 EDT
Can you try with:

perf report --stdio --sort=comm 

? The problem seems restricted to --tui, i.e. the default. I'm trying to fix it now.
Comment 6 RHEL Product and Program Management 2012-07-10 04:31:52 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 7 RHEL Product and Program Management 2012-07-10 19:52:14 EDT
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
Comment 8 Jiri Olsa 2012-08-29 06:38:28 EDT
fixed by BZ  846702 - perf tool 3.5 sync

*** This bug has been marked as a duplicate of bug 846702 ***

Note You need to log in before you can comment on or make changes to this bug.