[Bug tapsets/23799] New: sprint_ustack() returns empty strings while sprint_ubacktrace() does not

agentzh at gmail dot com sourceware-bugzilla@sourceware.org
Fri Oct 19 18:59:00 GMT 2018


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

            Bug ID: 23799
           Summary: sprint_ustack() returns empty strings while
                    sprint_ubacktrace() does not
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

Consider the following minimal C program:

```
int foo(void) {
    return 3;
}

int bar(void) {
    return foo();
}

int main(void) {
    bar();
    return 0;
}
```

Compile and link it like this:

```
gcc -g test.c
```

And then run the following stap oneliner:

```
stap -e 'probe process.function("foo") { printf("{%s}\n{%s}",
sprint_ustack(ubacktrace()), sprint_ubacktrace()); }' -c ./a.out --ldd
```

And the output is

```
{}
{foo+0x4 [a.out]
bar+0x9 [a.out]
main+0x9 [a.out]
__libc_start_main+0xea [libc-2.26.so]
_start+0x2a [a.out]}
```

The weird thing is that `sprint_ustack(ubacktrace())` returns an empty string
while `sprint_ubacktrace()` does not. Why the difference? Is there a bug in
`sprint_ustack()`? Any hints on debugging this thing?

Thanks!

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


More information about the Systemtap mailing list