Subject: kern/33087: SCHED_ASSERT_UNLOCK assertion in pool_get triggered through kpsignal2
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <cube@cubidou.net>
List: netbsd-bugs
Date: 03/15/2006 16:00:00
>Number:         33087
>Category:       kern
>Synopsis:       SCHED_ASSERT_UNLOCK assertion in pool_get triggered through kpsignal2
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 15 16:00:00 +0000 2006
>Originator:     Quentin Garnier
>Release:        NetBSD 3.99.17
>Organization:
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.
>Environment:
	Probably irrelevant, but got for a netbsd32 process on an amd64 system.
>How-To-Repeat:
	Run regress/lib/libpthread/sigalarm with a LOCKDEBUG kernel.

	What happens is that kpsignal2 does a lot of things under SCHED_LOCK,
	notably calling ksiginfo_put() in some situations.  That function calls
	pool_get() which triggers the assertion.
>Fix:
	Move the assertion in the WAITOK case in pool_get?