This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug dyninst/21223] Function return probe is not executed in dyninst mode
- From: "jackdev at mailbox dot org" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Tue, 07 Mar 2017 10:46:44 +0000
- Subject: [Bug dyninst/21223] Function return probe is not executed in dyninst mode
- Auto-submitted: auto-generated
- References: <bug-21223-6586@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21223
--- Comment #4 from Jack <jackdev at mailbox dot org> ---
I think there is some kind of memory corruption going on. I was able to narrow
down the problem to a very simple c program.
Stap script:
> #!/usr/bin/stap
> probe process.function("factor") {
> printf("[systemtap] Entered function factor\n")
> }
> probe process.function("factor").return {
> printf("[systemtap] Left function factor\n")
> }
C program (mwe.c):
> #include <stdio.h>
>
> long double a, b;
>
> void factor() {
> a = 0;
> b = a - 1;
> return;
> }
>
> int main() {
> printf("[mwe] Pre function factor\n");
> factor();
> printf("[mwe] Post function factor\n");
> return 0;
> }
Compile:
> $ gcc -O0 -o mwe mwe.c
> $
Run executable:
> $ ./mwe
> [mwe] Pre function factor
> [mwe] Post function factor
> $
Run systemtap
> $ stap --dyninst -c ./mwe runtime_dyninst.stp
> [mwe] Pre function factor
> [systemtap] Entered function factor
> $
(log: https://paste.debian.net/hidden/290051a6/ )
Notice how not even the second output of the binary gets printed!
However, switching just the data type for a,b from "long double" to int, float,
double, long, ... (line 3) lets the program fully execute:
> $ stap --dyninst -c ./mwe runtime_dyninst.stp
> [mwe] Pre function factor
> [mwe] Post function factor
> [systemtap] Entered function factor
> [systemtap] Left function factor
> $
(log: https://paste.debian.net/hidden/27410939/ )
--
You are receiving this mail because:
You are the assignee for the bug.