Subject: re: kern/34895: panic: sched_lock: locked
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: matthew green <mrg@eterna.com.au>
List: netbsd-bugs
Date: 10/26/2006 05:15:06
The following reply was made to PR kern/34895; it has been noted by GNATS.

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: re: kern/34895: panic: sched_lock: locked 
Date: Thu, 26 Oct 2006 15:13:15 +1000

 please try the following patch.  i have not yet had a chance to
 properly test it but it should help (and includes a change that
 i had included in earlier tests.)
 
 
 .mrg.
 
 
 Index: kern_sig.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/kern_sig.c,v
 retrieving revision 1.231
 diff -p -r1.231 kern_sig.c
 *** kern_sig.c	22 Oct 2006 20:48:45 -0000	1.231
 --- kern_sig.c	26 Oct 2006 05:10:45 -0000
 *************** kpsignal2(struct proc *p, const ksiginfo
 *** 1153,1172 ****
   	}
   
   	/*
 ! 	 * Allocate a ksiginfo_t incase we need to insert it with
 ! 	 * the scheduler lock held.
   	 */
 ! 	newkp = pool_get(&ksiginfo_pool, PR_NOWAIT);
 ! 	if (newkp == NULL) {
   #ifdef DIAGNOSTIC
 ! 		printf("kpsignal2: couldn't allocated from ksiginfo_pool\n");
   #endif
 ! 		return;
   	}
   
   	/* XXXSMP: works, but icky */
   	if (dolock)
   		SCHED_LOCK(s);
   
   	if (p->p_flag & P_SA) {
   		allsusp = 0;
 --- 1153,1176 ----
   	}
   
   	/*
 ! 	 * Allocate a ksiginfo_t incase we need to insert it with the
 ! 	 * scheduler lock held, but only if this ksiginfo_t isn't empty.
   	 */
 ! 	if (dolock && !KSI_EMPTY_P(ksi)) {
 ! 		newkp = pool_get(&ksiginfo_pool, PR_NOWAIT);
 ! 		if (newkp == NULL) {
   #ifdef DIAGNOSTIC
 ! 			printf("kpsignal2: couldn't allocated from ksiginfo_pool\n");
   #endif
 ! 			return;
 ! 		}
   	}
   
   	/* XXXSMP: works, but icky */
   	if (dolock)
   		SCHED_LOCK(s);
 + 	else
 + 		newkp = NULL;
   
   	if (p->p_flag & P_SA) {
   		allsusp = 0;