cvs commit: src/sys/kern kern_sig.c

John Baldwin jhb at FreeBSD.org
Thu Mar 3 22:15:01 GMT 2005


On Thursday 03 March 2005 10:21 am, Daniel Eischen wrote:
> On Thu, 3 Mar 2005, Scott Long wrote:
> > It's not about convenience or taking the easy way out.  Let's fix
> > sigwait() to have the proper assumptions and go from there.  I'm
> > inclined to agree with John that the problem is not widespread or
> > impossible to track down.  Fixing it is not hard either, we already have
> > the PHOLD()/PRELE() functions for doing exactly what is needed here.
>
> Can you add assertions in msleep(), cv_wait(), etc, to
> panic if the object is on the kernel stack and the
> stack is swappable?

Just because you sleep on a stack address doesn't mean that you are going to 
write to that object when doing a wakeup.  However, it might not be a bad 
idea as stack address can be indicative of bugs like this:

foo(void *bar, ...)
{
	msleep(&bar);
}

rather than doing

foo(void *bar, ...)
{
	msleep(bar);
}

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the cvs-src mailing list