Subject: Re: kern/37004
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Aaron J. Grier <aaron@frye.com>
List: netbsd-bugs
Date: 09/19/2007 21:10:10
The following reply was made to PR kern/37004; it has been noted by GNATS.

From: "Aaron J. Grier" <aaron@frye.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/37004
Date: Wed, 19 Sep 2007 12:09:17 -0700

 I added a case for SDYING in kern/kern_sig.c::kpsignal2() to match the
 SIDL case:
 
 Index: kern/kern_sig.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/kern_sig.c,v
 retrieving revision 1.240.2.1
 diff -u -r1.240.2.1 kern_sig.c
 --- kern/kern_sig.c	21 Jan 2007 16:44:23 -0000	1.240.2.1
 +++ kern/kern_sig.c	19 Sep 2007 18:12:16 -0000
 @@ -1386,6 +1386,12 @@
  		/* Process is being created by fork */
  		/* XXX: We are not ready to receive signals yet */
  		goto done;
 +
 +	case SDYING:
 +		/* Process is busy dying */
 +		/* XXX: don't panic! */
 +		goto done;
 +
  	default:
  		/* Else what? */
  		panic("psignal: Invalid process state %d.", p->p_stat);
 
 but now things just trundle off into the weeds:
 
 uvm_fault
 kernel: supervisor trap page fault, code=0
 ttyinfo
 ttyinput_wlock
 ttyinput
 ptcwrite
 spec_write
 VOP_WRITE
 [...]
 
 may need to back up and figure out why a thread that's SDYING does not
 also have SA_NOKERNINFO attached to it...  I'll start digging in
 kern_exit.c.  any suggestions you can throw my way would be helpful.
 
 -- 
   Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron@frye.com