When you ptrace(PTRACE_ATTACH) a process, how do you know when it's safe
to do another ptrace operation? I'm seeing successive ptrace operations
fail with ESRCH because the SIGSTOP hasn't yet been delivered.
The particular case where I see this is 'pstack $$' (from bash) -- but it
only happens about one time in ten. (<http://www.whatsis.com/pstack/>)
This happens with 2.2.13pre15 and with 2.3.20. Intuitively, the check
that the target process is traced should check for pending STOPs (and
either deliver them or return -ERESTARTSYS or something), or else
PTRACE_ATTACH should wait until the target process has had its signal
delivered.
Comments?
Tim.
*/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/