Commit 63bd6144 authored by Roland McGrath's avatar Roland McGrath Committed by Linus Torvalds

[PATCH] Invalid BUG_ONs in signal.c

Oh, duh.  The race is obvious.  Sorry for the confusion there.

The BUG_ON's were useful for debugging, since they trigger on a lot of
errors, but they _also_ trigger on some unlikely (but valid) races.

So just remove them - just fall through to the regular exit code after
core-dumping (which does everything right).
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8421a12c
......@@ -1903,22 +1903,16 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
* Anything else is fatal, maybe with a core dump.
*/
current->flags |= PF_SIGNALED;
if (sig_kernel_coredump(signr) &&
do_coredump((long)signr, signr, regs)) {
/*
* That killed all other threads in the group and
* synchronized with their demise, so there can't
* be any more left to kill now. The group_exit
* flags are set by do_coredump. Note that
* thread_group_empty won't always be true yet,
* because those threads were blocked in __exit_mm
* and we just let them go to finish dying.
*/
const int code = signr | 0x80;
BUG_ON(!current->signal->group_exit);
BUG_ON(current->signal->group_exit_code != code);
do_exit(code);
/* NOTREACHED */
if (sig_kernel_coredump(signr)) {
/*
* If it was able to dump core, this kills all
* other threads in the group and synchronizes with
* their demise. If we lost the race with another
* thread getting here, it set group_exit_code
* first and our do_group_exit call below will use
* that value and ignore the one we pass it.
*/
do_coredump((long)signr, signr, regs);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment