[PATCH v2] USE_SEIZE: fix detaching from stopped processes
Dmitry V. Levin
ldv at altlinux.org
Wed Jun 19 11:24:42 UTC 2013
On Wed, Jun 19, 2013 at 12:58:13PM +0200, Denys Vlasenko wrote:
> V2: check WSTOPSIG(status) == syscall_trap_sig, not SIGTRAP.
> Add comments explaining what we think about the process status
> in detach() at various steps. Simplify PTRACE_CONT
> in wait loop since now syscall_trap_sig can't be seen there.
> Verified that tests/detach works.
With this patch,
tests/detach-running fails (detach hangs) in use_seize case,
tests/detach-sleeping fails (detach hangs) in !use_seize case.
> * strace.c (detach) [USE_SEIZE]: If PTRACE_SEIZE API is in use, stop
> the tracee using PTRACE_INTERRUPT instead of sending it a SIGSTOP.
> In a subsequent waitpid loop, wait for either SIGSTOP or syscall_trap_sig.
detach() uses no USE_SEIZE ifdefs, so there should be no [USE_SEIZE].
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: not available
More information about the Strace-devel