This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dyninst/21223] Function return probe is not executed in dyninst mode


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]