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 - 5:13 am

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

Yes, you're right. My patch only works OK in the ptrace_notify() case,
not when it is called from get_signal_to_deliver().

So, do you think it's a better idea to add a new flag to notify the
tracee that its tracer disappeared? That way it can decide how to handle
the situation in ptrace_stop(), something along these lines:

--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1628,6 +1628,8 @@ ptrace_stop(int exit_code, int c
 		do_notify_parent_cldstop(current, CLD_TRAPPED);
 		read_unlock(&tasklist_lock);
 		schedule();
+		if (current->flags & PF_PTRACEORPHAN & clear_code)
+			current->exit_code = 0;
 	} else {
 		/*
 		 * By the time we got the lock, our tracer went away.

And then replace p->exit_code = 0 in my original patch with something
like p->flags |= PF_PTRACEORPHAN. Better?

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, 5:13 am)
speck-geostationary