Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6-0]: src/sys/kern Pull up following revision(s) (requested by pg...



details:   https://anonhg.NetBSD.org/src/rev/59ba8e1d5c40
branches:  netbsd-6-0
changeset: 775095:59ba8e1d5c40
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Nov 15 20:40:26 2015 +0000

description:
Pull up following revision(s) (requested by pgoyette in ticket #1334):
        sys/kern/kern_sig.c: revision 1.321
When delivering a signal, it's possible that the process's state in
p_stat is SACTIVE yet p_sflag is PS_STOPPING (while waiting for other
lwp's to stop).  In that case, we don't want to adjust the parent's
p_nstopchild count.
Found by Robert Elz.
XXX Pullups to: NetBSD-7, -6{,-0,-1}, and -5{,-0,-1,-2}

diffstat:

 sys/kern/kern_sig.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (37 lines):

diff -r f8fbc52cb880 -r 59ba8e1d5c40 sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Sun Nov 15 20:38:01 2015 +0000
+++ b/sys/kern/kern_sig.c       Sun Nov 15 20:40:26 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $   */
+/*     $NetBSD: kern_sig.c,v 1.316.12.1 2015/11/15 20:40:26 bouyer Exp $       */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316.12.1 2015/11/15 20:40:26 bouyer Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_compat_sunos.h"
@@ -1461,14 +1461,13 @@
                }
                if ((prop & SA_CONT) != 0 || signo == SIGKILL) {
                        /*
-                        * Re-adjust p_nstopchild if the process wasn't
-                        * collected by its parent.
+                        * Re-adjust p_nstopchild if the process was
+                        * stopped but not yet collected by its parent.
                         */
+                       if (p->p_stat == SSTOP && !p->p_waited)
+                               p->p_pptr->p_nstopchild--;
                        p->p_stat = SACTIVE;
                        p->p_sflag &= ~PS_STOPPING;
-                       if (!p->p_waited) {
-                               p->p_pptr->p_nstopchild--;
-                       }
                        if (p->p_slflag & PSL_TRACED) {
                                KASSERT(signo == SIGKILL);
                                goto deliver;



Home | Main Index | Thread Index | Old Index