public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/26844] New: off-by-one error in the output of sprint_ubacktrace()
@ 2020-11-04 21:59 agentzh at gmail dot com
  2020-11-04 22:00 ` [Bug runtime/26844] " agentzh at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: agentzh at gmail dot com @ 2020-11-04 21:59 UTC (permalink / raw)
  To: systemtap

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-12 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 21:59 [Bug runtime/26844] New: off-by-one error in the output of sprint_ubacktrace() agentzh at gmail dot com
2020-11-04 22:00 ` [Bug runtime/26844] " agentzh at gmail dot com
2020-11-05  0:29 ` agentzh at gmail dot com
2020-12-09 18:24 ` demonsingur at gmail dot com
2020-12-12 14:16 ` fche at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).