Messages in this thread | | | Date | Sat, 19 Feb 2011 21:16:03 +0100 | From | Oleg Nesterov <> | Subject | Re: [PATCH 1/1] ptrace: make sure do_wait() won't hang after PTRACE_ATTACH |
| |
On 02/18, Jan Kratochvil wrote: > > On Thu, 17 Feb 2011 20:19:52 +0100, Oleg Nesterov wrote: > > > > That is after PTRACE_DETACH(0) the process should remain `T (stopped)' > > > > iff the process was `T (stopped)' before PTRACE_ATTACH. > > > > - PTRACE_DETACH(0) should preserve `T (stopped)'. > > > > > > I assume you are thinking about PTRACE_ATTACH + wait():SIGSTOP > > > + PTRACE_DETACH(0) sequence. > > > > plus it should be stopped before attach, I assume. Otherwise this > > not true with the current code. > > I did not talk about the current code. I was making a proposal of new > behavior (which should not break existing software).
Confused.
> If PTRACE_ATTACH was done on process with `T (stopped)'
this matters "it should be stopped before attach"
> then after > PTRACE_DETACH(0) again the process should be `T (stopped)'.
Regardless of what the debugger did in between? This can't be right. I'd say, it doesn't make sense to take the state of the tracee before PTRACE_ATTACH into account. What does matter, is its state before PTRACE_DETACH.
If the debugger did not resume the tracee before PTRACE_DETACH, then of course I agree, PTRACE_DETACH(0) should preserve T (stopped).
But again, lets discuss this separately.
Oleg.
| |