kern/72979: unkillable process(es) stuck in `STOP' state

David Xu davidxu at freebsd.org
Tue Jan 2 03:10:23 PST 2007


The following reply was made to PR kern/72979; it has been noted by GNATS.

From: David Xu <davidxu at freebsd.org>
To: "Andrew Pantyukhin" <infofarmer at freebsd.org>
Cc: bug-followup at freebsd.org,
 "Mikhail Teterin" <mi at freebsd.org>
Subject: Re: kern/72979: unkillable process(es) stuck in `STOP' state
Date: Tue, 2 Jan 2007 19:09:15 +0800

 I have updated the patch, please use this patch instead:
 
 Index: kern_exit.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/kern/kern_exit.c,v
 retrieving revision 1.294
 diff -u -r1.294 kern_exit.c
 --- kern_exit.c	25 Oct 2006 06:18:04 -0000	1.294
 +++ kern_exit.c	2 Jan 2007 11:06:56 -0000
 @@ -413,8 +413,12 @@
  	 */
  	sx_xlock(&proctree_lock);
  	q = LIST_FIRST(&p->p_children);
 -	if (q != NULL)		/* only need this if any child is S_ZOMB */
 +	if (q != NULL) {	/* only need this if any child is S_ZOMB */
 +		PROC_LOCK(initproc);
  		wakeup(initproc);
 +		psignal(initproc, SIGCHLD);
 +		PROC_UNLOCK(initproc);
 +	}
  	for (; q != NULL; q = nq) {
  		nq = LIST_NEXT(q, p_sibling);
  		PROC_LOCK(q);
 @@ -479,13 +483,16 @@
  	} else
  		mtx_unlock(&p->p_pptr->p_sigacts->ps_mtx);
  
 -	if (p->p_pptr == initproc)
 -		psignal(p->p_pptr, SIGCHLD);
 -	else if (p->p_sigparent != 0) {
 +	if (p->p_pptr == initproc) {
 +		wakeup(initproc);
 +		psignal(initproc, SIGCHLD);
 +	} else if (p->p_sigparent != 0) {
  		if (p->p_sigparent == SIGCHLD)
  			childproc_exited(p);
 -		else	/* LINUX thread */
 +		else {	/* LINUX thread */
 +			wakeup(p->p_pptr);
  			psignal(p->p_pptr, p->p_sigparent);
 +		}
  	}
  	PROC_UNLOCK(p->p_pptr);
  	PROC_UNLOCK(p);


More information about the freebsd-bugs mailing list