From ab118c9359c947fb02e7199de6c6ea31d53a0fe4 Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Sun, 30 Oct 2005 15:02:38 -0800 Subject: [PATCH] --- yaml --- r: 11844 b: refs/heads/master c: 30e0fca6c1d7d26f3f2daa4dd2b12c51dadc778a h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/ptrace.c | 7 +++++-- trunk/kernel/signal.c | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 67717faf53d5..4fbc8bb53794 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 68860ec10bcc07ab4f89f9d940e3b77ae5ca13b3 +refs/heads/master: 30e0fca6c1d7d26f3f2daa4dd2b12c51dadc778a diff --git a/trunk/kernel/ptrace.c b/trunk/kernel/ptrace.c index 019e04ec065a..863eee8bff47 100644 --- a/trunk/kernel/ptrace.c +++ b/trunk/kernel/ptrace.c @@ -56,6 +56,10 @@ void ptrace_untrace(task_t *child) signal_wake_up(child, 1); } } + if (child->signal->flags & SIGNAL_GROUP_EXIT) { + sigaddset(&child->pending.signal, SIGKILL); + signal_wake_up(child, 1); + } spin_unlock(&child->sighand->siglock); } @@ -77,8 +81,7 @@ void __ptrace_unlink(task_t *child) SET_LINKS(child); } - if (child->state == TASK_TRACED) - ptrace_untrace(child); + ptrace_untrace(child); } /* diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c index 1d905ec74bde..9d1512dcf176 100644 --- a/trunk/kernel/signal.c +++ b/trunk/kernel/signal.c @@ -1108,8 +1108,8 @@ void zap_other_threads(struct task_struct *p) if (t != p->group_leader) t->exit_signal = -1; + /* SIGKILL will be handled before any pending SIGSTOP */ sigaddset(&t->pending.signal, SIGKILL); - rm_from_queue(SIG_KERNEL_STOP_MASK, &t->pending); signal_wake_up(t, 1); } } @@ -1879,9 +1879,9 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, /* Let the debugger run. */ ptrace_stop(signr, signr, info); - /* We're back. Did the debugger cancel the sig? */ + /* We're back. Did the debugger cancel the sig or group_exit? */ signr = current->exit_code; - if (signr == 0) + if (signr == 0 || current->signal->flags & SIGNAL_GROUP_EXIT) continue; current->exit_code = 0;