From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 86EFA3944820; Wed, 4 Nov 2020 21:59:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86EFA3944820 From: "agentzh at gmail dot com" 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 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: agentzh at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2020 21:59:58 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26844 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. --=20 You are receiving this mail because: You are the assignee for the bug.=