cvs commit: src/sys/kern kern_sig.c

Bruce Evans bde at zeta.org.au
Fri Mar 4 16:34:04 GMT 2005


On Thu, 3 Mar 2005, John Baldwin wrote:

> On Thursday 03 March 2005 10:21 am, Daniel Eischen wrote:
>> 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:

Sleeping on a stack address is just a bug, since it depends on the
undocumented (?) implementation detail that stacks for diferent processes
don't overlap for the address to be unique.  Overlapping stacks was the
the usual case until relatively recently.  For threads in the same process,
the stacks must be separate to work, but this need not be the case for
processes.

Bruce


More information about the cvs-src mailing list