Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Mar 2005 03:33:55 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@freebsd.org>
Cc:        David Xu <davidxu@freebsd.org>
Subject:   Re: cvs commit: src/sys/kern kern_sig.c
Message-ID:  <20050305032619.K18638@delplex.bde.org>
In-Reply-To: <200503031116.22840.jhb@FreeBSD.org>
References:  <Pine.GSO.4.43.0503031020180.2058-100000@sea.ntplx.net> <200503031116.22840.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050305032619.K18638>