Subject: Re: kpsignal2 panic
To: Andrey Petrov <petrov@netbsd.org>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 10/03/2003 15:49:05
At 03:42 PM 10/3/2003, Andrey Petrov wrote:
>And it did fixes the problem. Here's another patch for review.
>
>Index: kern_sig.c
>===================================================================
>RCS file: /cvsroot/src/sys/kern/kern_sig.c,v
>retrieving revision 1.163
>diff -c -p -r1.163 kern_sig.c
>*** kern_sig.c  3 Oct 2003 17:51:13 -0000       1.163
>--- kern_sig.c  3 Oct 2003 22:34:42 -0000
>*************** psignal1(struct proc *p, int signum, int
>*** 961,970 ****
>--- 961,983 ----
>   void
>   kpsignal1(struct proc *p, ksiginfo_t *ksi, void *data, int dolock)
>   {
>+
>+       if (p->p_flag & P_WEXIT)
>+               return;
>+
>         if (data) {
>                 size_t fd;
>                 struct filedesc *fdp = p->p_fd;
>                 ksi->ksi_fd = -1;
>+
>+               if (fdp == NULL) {
>+ #ifdef DIAGNOSTIC
>+                       printf("kpsignal1: fdp NULL, proc %d flags %x\n",
>+                              p->p_pid, p->p_flag);
>+ #endif
>+                       return;
>+               }
>+
>                 for (fd = 0; fd < fdp->fd_nfiles; fd++) {
>                         struct file *fp = fdp->fd_ofiles[fd];
>                         /* XXX: lock? */


Looks good to me.  (but you might to move the entire if inside the #ifdef).


-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.