Bug 17181 - systemtap has problems attaching to resumed processes
Summary: systemtap has problems attaching to resumed processes
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-18 19:31 UTC by David Smith
Modified: 2014-07-18 20:51 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2014-07-18 19:31:28 UTC
Systemtap will error when attempting to attach to a resumed process. This happens with "fake" utrace (seen on RHEL7 and f20).
 
====
# stap -v -e 'probe syscall.getpid { printf("%s\n", probefunc()) }'
<snip>
Pass 5: starting run.
sys_getpid
<snip>
ERROR: utrace_set_events returned error -114 on pid 1903
WARNING: /usr/bin/staprun exited with status: 1
Pass 5: run completed in 0usr/70sys/8196real ms.
Pass 5: run failed.  [man error::pass5]
====

Here's how to reproduce this one:

1. Compile the following C code to 'a.out'.
====
#include <unistd.h>
#include <signal.h>
 
void main()
{
    kill(getpid(), SIGSTOP);
    getpid();
}
====
 
2. Run 'a.out' in the background.

# ./a.out &
[1] <pid>
 
3. Execute stap command in another console.
# stap -v -e 'probe syscall.getpid { printf("%s\n", probefunc()) }'
 
4. Resume the stopped process
# kill -cont <pid>

Sometimes the stopped process can get stuck in the 't' state till
kill -9'd.
Comment 1 David Smith 2014-07-18 19:32:45 UTC
Note that this one is somewhat related to bug #17127. I know believe the fix there wasn't right.
Comment 2 David Smith 2014-07-18 20:51:49 UTC
Fixed in commit d9d07e9, which also adds a testcase. Basically our utrace wasn't interrupting processes properly.

Note that this commit reverts the bug #17127 fix.