PR/24750: Frank Kardel: panic when process is signalled during trunk
authorchristos <christos@NetBSD.org>
Thu, 11 Mar 2004 22:34:26 +0000
branchtrunk
changeset 124673 74db40a8b4e6
parent 124672 04292780867f
child 124674 211e4d02bdb7
PR/24750: Frank Kardel: panic when process is signalled during proc initialization.
sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c	Thu Mar 11 21:48:43 2004 +0000
+++ b/sys/kern/kern_sig.c	Thu Mar 11 22:34:26 2004 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig.c,v 1.185 2004/03/04 00:05:58 matt Exp $	*/
+/*	$NetBSD: kern_sig.c,v 1.186 2004/03/11 22:34:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.185 2004/03/04 00:05:58 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.186 2004/03/11 22:34:26 christos Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_compat_sunos.h"
@@ -1161,7 +1161,8 @@
 		}
 	}
 
-	if (p->p_stat == SACTIVE) {
+	switch (p->p_stat) {
+	case SACTIVE:
 
 		if (l != NULL && (p->p_flag & P_TRACED))
 			goto run;
@@ -1219,7 +1220,7 @@
 		 */
 		goto runfast;
 		/*NOTREACHED*/
-	} else if (p->p_stat == SSTOP) {
+	case SSTOP:
 		/* Process is stopped */
 		/*
 		 * If traced process is already stopped,
@@ -1283,7 +1284,11 @@
 		if (l)
 			goto run;
 		goto out;
-	} else {
+	case SIDL:
+		/* Process is being created by fork */
+		/* XXX: We are not ready to receive signals yet */
+		goto done;
+	default:
 		/* Else what? */
 		panic("psignal: Invalid process state %d.", p->p_stat);
 	}