[Bug translator/26670] New: In "end" probe, symbol lookup for user stacks is broken (print_usyms/print_ustack functions)

barrdetwix at gmail dot com sourceware-bugzilla@sourceware.org
Sun Sep 27 18:48:21 GMT 2020


https://sourceware.org/bugzilla/show_bug.cgi?id=26670

            Bug ID: 26670
           Summary: In "end" probe, symbol lookup for user stacks is
                    broken (print_usyms/print_ustack functions)
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: barrdetwix at gmail dot com
  Target Milestone: ---

I have a script that saves backtraces and tries defers resolving symbols until
the end, to reduce the overhead.

But it seems that resolving user symbols only works in regular probes, not in
the "end" probe. There is no error, the symbols just fail to resolve.
Note that there is no such problem for kernel stacks.

Version info:
Systemtap translator/driver (version 4.4/0.181, commit
release-4.3-75-g747902edd81a)
Linux 5.8.0-2-amd64 #1 SMP Debian 5.8.10-1 (2020-09-19) x86_64

Please see the following reproducer script (and the output I get below):

// stap_end_userstack.stp
global ustack;

probe vfs.read {
    ustack = ubacktrace();

    println("--- In vfs probe");
    print_usyms(ustack);
    exit();
}

probe end {
    println("--- In end probe");
    print_usyms(ustack);
}


$ sudo stap -d /bin/ntfs-3g -d /lib/x86_64-linux-gnu/libpthread-2.31.so -v
stap_end_userstack.stp
Pass 1: parsed user script and 476 library scripts using
93152virt/78928res/9964shr/69012data kb, in 140usr/30sys/170real ms.
Pass 2: analyzed script: 2 probes, 6 functions, 6 embeds, 1 global using
253976virt/241524res/11684shr/229836data kb, in 1500usr/130sys/1642real ms.
Pass 3: translated to C into
"/tmp/stapri4GCL/stap_7a0d3cf3937b410061615c1e75142f3c_4334_src.c" using
253976virt/241720res/11880shr/229836data kb, in 330usr/20sys/343real ms.
Pass 4: compiled C into "stap_7a0d3cf3937b410061615c1e75142f3c_4334.ko" in
8990usr/570sys/6673real ms.
Pass 5: starting run.
WARNING: Missing unwind data for a module, rerun with 'stap -d
/lib/x86_64-linux-gnu/libc-2.31.so'
--- In vfs probe
 0x7f65a1cb504e : __read+0xe/0xa0 [/lib/x86_64-linux-gnu/libpthread-2.31.so]
 0x55b8595b3012 : 0x55b8595b3012 [/bin/ntfs-3g+0x1a012/0x23000]
 0x55b8595ad26d : 0x55b8595ad26d [/bin/ntfs-3g+0x1426d/0x23000]
 0x55b85959f35f : 0x55b85959f35f [/bin/ntfs-3g+0x635f/0x23000]
 0x7f65a1aafcca : 0x7f65a1aafcca
[/lib/x86_64-linux-gnu/libc-2.31.so+0x26cca/0x1c1000]
--- In end probe
 0x7f65a1cb504e : 0x7f65a1cb504e
 0x55b8595b3012 : 0x55b8595b3012
 0x55b8595ad26d : 0x55b8595ad26d
 0x55b85959f35f : 0x55b85959f35f
 0x7f65a1aafcca : 0x7f65a1aafcca
Pass 5: run completed in 10usr/70sys/677real ms.

As you can see, the user stack resolves correctly in a regular probe, but not
in the end probe.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Systemtap mailing list