Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-16130

print_ubacktrace_fileline() doesn't show file and line numbers

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Undefined Undefined
    • None
    • rhel-9.3.0
    • None
    • sst_pt_perf_debug
    • ssg_platform_tools
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      When troubleshooting userspace programs, I very often use systemtap to reconstruct the call stack of a given function or syscall to easily spot the source code, e.g.:

      # debuginfo-install -y glibc coreutils
      [...]
      
      # stap -d kernel -d /usr/bin/sleep --ldd -c "/usr/bin/sleep 1" -e 'probe syscall.clock_nanosleep { if (pid() != target()) next; print_ubacktrace() }'
      
       0x7f335171393a : clock_nanosleep@@GLIBC_2.17+0x2a/0x90 [/usr/lib64/libc.so.6]
       0x7f3351718527 : nanosleep+0x17/0x40 [/usr/lib64/libc.so.6]
       0x559e8322ca00 : main+0x400/0x590 [/usr/bin/sleep]
       0x7f335163feb0 : __libc_start_call_main+0x80/0xb0 [/usr/lib64/libc.so.6]
       0x7f335163ff60 : __libc_start_main@GLIBC_2.2.5+0x80/0x150 [/usr/lib64/libc.so.6]
       0x559e8322cbb5 : _start+0x25/0x30 [/usr/bin/sleep]
      

      Above only symbols with offset are printed, which is of great help but still requires from me to disassemble the function (e.g. main() above) to spot the exact source code location.

      I just found there was even better theoretically (print_ubacktrace_fileline()) which would print file and line numbers. Unfortunately this doesn't help, I get exact same output as print_ubacktrace():

      # stap -d kernel -d /usr/bin/sleep --ldd -c "/usr/bin/sleep 1" -e 'probe syscall.clock_nanosleep { if (pid() != target()) next; print_ubacktrace_fileline() }'
       0x7f642a91393a : clock_nanosleep@@GLIBC_2.17+0x2a/0x90 [/usr/lib64/libc.so.6]
       0x7f642a918527 : nanosleep+0x17/0x40 [/usr/lib64/libc.so.6]
       0x559f5819da00 : main+0x400/0x590 [/usr/bin/sleep]
       0x7f642a83feb0 : __libc_start_call_main+0x80/0xb0 [/usr/lib64/libc.so.6]
       0x7f642a83ff60 : __libc_start_main@GLIBC_2.2.5+0x80/0x150 [/usr/lib64/libc.so.6]
       0x559f5819dbb5 : _start+0x25/0x30 [/usr/bin/sleep]
      

      Please provide the package NVR for which bug is seen:

      systemtap-4.9-3.el9.x86_64

      How reproducible:

      Always, see above.

      Expected results

      Filename and line numbers.

      Actual results

      Just symbol name and offset.

            rhtorsys Frank Eigler
            rhn-support-rmetrich Renaud Métrich
            Frank Eigler Frank Eigler
            qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: