Re: [PATCH] cleanup ptrace stops and remove notify_parent

From: Linus Torvalds
Date: Mon Aug 30 2004 - 23:29:29 EST




On Mon, 30 Aug 2004, Roland McGrath wrote:
>
> This adds a new state TASK_TRACED that is used in place of TASK_STOPPED
> when a thread stops because it is ptraced. Now ptrace operations are only
> permitted when the target is in TASK_TRACED state, not in TASK_STOPPED.
> This means that if a process is stopped normally by a job control signal
> and then you PTRACE_ATTACH to it, you will have to send it a SIGCONT before
> you can do any ptrace operations on it. (The SIGCONT will be reported to
> ptrace and then you can discard it instead of passing it through when you
> call PTRACE_CONT et al.)

Ok, I definitely agree with the approach (I've not become schizofrenic
yet, but as others can attest, I obviously change my mind occasionally, so
sometimes I disagree even with my own suggestions ;)

Looks pretty clean as an implementation. The question is whether we should
aim for 2.6.9 or 2.6.10 - if the first, then I should probably take it
now, otherwise it should go into -mm first and be merged early after 2.6.9
has been released, for the first -rc.

I _looks_ pretty safe, and it's hopefully much less likely to have subtle
bugs and races than our old approach had, but I have a hard time judging.
I assume you ran all your gdb tests on the result? What's your gut feel?

Linus
-
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/