Subject: locking botch in kpsignal2()
To: None <tech-kern@netbsd.org>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 10/17/2006 15:24:09
hi folks.


i was just running "make regress" on a LOCKDEBUG kernel and it crashed at :

	regress ===> lib/libc/siginfo/sigalrm
	./sigalrm

the problem is that kpsignal2() calls SCHED_LOCK() and then calls
ksiginfo_put() which calls pool_get(), and pool_get() complains with
LOCKDEBUG and the sched_lock being taken.

i'm not entirely sure the right way to fix this.  the problem callers
of ksiginfo_put() are all at the bottom of kpsignal2(), from runfast:
label onwards.  you'll notice the XXXSMP markers around the sched_lock
calls here too.  i guess moving all the callers of ksiginfo_put() after
the SCHED_UNLOCK(s) call, ensuring that only the same cases call it
would work...

any good ideas?

thanks.


.mrg.