RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 826556 - perf report segfault when using --sort
Summary: perf report segfault when using --sort
Keywords:
Status: CLOSED DUPLICATE of bug 846702
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.3
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jiri Olsa
QA Contact: Guangze Bai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-30 13:52 UTC by William Cohen
Modified: 2019-07-12 07:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-29 10:38:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description William Cohen 2012-05-30 13:52:38 UTC
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 14:20:13 UTC
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 14:44:55 UTC
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 Program Management 2012-07-10 08:31:52 UTC
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 Program Management 2012-07-10 23:52:14 UTC
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 10:38:28 UTC
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.