login
Header Space

 
 

Re: [PATCH] Discard notification signals when a tracer exits

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Oleg Nesterov <oleg@...>
Cc: <linux-kernel@...>, Roland McGrath <roland@...>
Date: Wednesday, March 26, 2008 - 4:48 am

On Tue, 2008-03-25 at 19:16 +0300, Oleg Nesterov wrote:

If the ptracer wakes up the tracee, then it is no longer in the state
TASK_TRACED.


You're missing the point. The child _is_ traced before sending the
signal. It leaves the notification code in ->exit_code, so that the
tracer can fetch it with a call to wait4(). Later, the same field is
used to tell the tracee which signal the tracer delivered to it.
However, if the tracer dies before it reads (and resets) the value in
->exit_code, the tracee interprets the notification code as the signal
to be delivered.


Hm, what if the tracer gets actually killed by the kernel, e.g. by the
OOM killer? How would you fix that in userspace?

Anyway, if you really want to have broken behaviour on unexpected tracer
exits, then we'd better not change the tracee's state from TASK_TRACED
at all. That way it stays hanging in the system and the admin can decide
whether they want to shoot it down with a SIGKILL or attach a debugger
to it and somehow resume the process. Arranging for a delivery of a
non-existent SIGTRAP seems utterly illogical to me.

Cheers,
Petr Tesarik

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Discard notification signals when a tracer exits, Petr Tesarik, (Tue Mar 25, 10:31 am)
Re: [PATCH] Discard notification signals when a tracer exits, Petr Tesarik, (Wed Mar 26, 4:48 am)
speck-geostationary