[Bug runtime/26844] New: off-by-one error in the output of sprint_ubacktrace()
agentzh at gmail dot com
sourceware-bugzilla@sourceware.org
Wed Nov 4 21:59:58 GMT 2020
https://sourceware.org/bugzilla/show_bug.cgi?id=26844
Bug ID: 26844
Summary: off-by-one error in the output of sprint_ubacktrace()
Product: systemtap
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: runtime
Assignee: systemtap at sourceware dot org
Reporter: agentzh at gmail dot com
Target Milestone: ---
Consider the following C program for the target program:
```
int foo(void) {
return 3;
}
int bar(void) {
return foo();
}
int main(void) {
bar();
return 0;
}
```
Compile it to generate the executable file `./a.out`:
```
gcc -g a.c
```
And then run the following stap oneliner:
```
$ stap -e 'probe oneshot { printf("{%s}\n", sprint_ubacktrace()) }'
{foo+0x4 [a.out]
bar+0x9 [a.out]
main+0x9 [a.out]
0x7ffff7a3b11b [libc-2.27.so+0x2311b]}
WARNING: Missing unwind data for a module, rerun with 'stap -d
/usr/lib64/libc-2.27.so'
```
The warning can be safely ignored. What's unexpected here is the lack of
newline at the end of the last frame in the generated backtrace (between the
bytes `]` and `}` in the output above).
The current master of the upstream systemtap git repo also has the same
problem. We should commit any fixes to the upstream as well for this.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Systemtap
mailing list