Re: Race in ptrace.

From: Roland McGrath
Date: Thu Feb 11 2010 - 15:56:16 EST


> What I don't agree with is that when we send SIGCONT later with
> "kill", we wake up the child at all. It may make sense to someone who
> has access to the kernel source code, but from a user's point of view
> this is a surprise. The signal is intercepted and should not have an
> effect on the child.

This is the behavior of SIGCONT and doesn't really have anything to do with
ptrace. Once you have let the SIGSTOP through, the process is in job
control stop just like if you'd sent a SIGSTOP without using ptrace at all.

The distinction that is confusing you is that *generating* SIGCONT is what
resumes the process, not *delivering* it. Another example is that if your
process has SIGCONT blocked or ignored, SIGCONT still wakes it up. Another
example is that SIGCONT wakes up all the threads in a process, before one
of those threads delivers the SIGCONT (i.e. runs a handler).


Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/