lkml.org 
[lkml]   [1998]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: A bug in setpgid in kernel
Date
Nick Holloway <Nick.Holloway@alfie.demon.co.uk> writes:
> > hjl@lucon.org (H.J. Lu) writes:
> > While working on the POSIX testsuite, I think I found another kernel
> > bug. This time it is setpgid.
>
> [snip] However, I can't see anything
> that would stop the kernel attempting to deliver the HUP signal to the
> zombie child (the one currently in exit_notify) via kill_pg. If this
> is the case, then the exit_code gets set to 0, which overwrites the
> expected exit code of 134 set in do_exit().

I have done some further investigation, and this does appear to be
the problem. I have diffed bits of code between 2.0 and 2.1, and the
problem is that the code which skips delivery of signals to zombie
processes which was present in the 2.0 send_sig (kernel/exit.c) is not
present in the 2.1 send_sig_info (kernel/signal.c).

The following is a patch against 2.1.127 (I haven't got 2.1.128 yet).

--- kernel/signal.c-dist Wed Nov 18 19:52:46 1998
+++ kernel/signal.c Wed Nov 18 20:59:50 1998
@@ -4,6 +4,7 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*
* 1997-11-02 Modified for POSIX.1b signals by Richard Henderson
+ * 1998-11-18 Don't delivery signals to zombies (as in 2.0), Nick Holloway
*/

#include <linux/module.h>
@@ -281,6 +282,12 @@
ret = 0;
if (!sig)
goto out_nolock;
+
+ /*
+ * Forget it if the process is already zombie'd.
+ */
+ if (!t->sig)
+ return 0;

spin_lock_irqsave(&t->sigmask_lock, flags);
switch (sig) {
--
`O O' | Home: Nick.Holloway@alfie.demon.co.uk http://www.alfie.demon.co.uk/
// ^ \\ | Work: Nick.Holloway@parallax.co.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.151 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site