public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "agentzh at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug runtime/26844] New: off-by-one error in the output of sprint_ubacktrace()
Date: Wed, 04 Nov 2020 21:59:58 +0000	[thread overview]
Message-ID: <bug-26844-6586@http.sourceware.org/bugzilla/> (raw)

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.

             reply	other threads:[~2020-11-04 21:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 21:59 agentzh at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26844-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).