Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Feb 2007 18:27:55 +1030
From:      Greg 'groggy' Lehey <grog@FreeBSD.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/share/man/man9 sleep.9
Message-ID:  <20070228075755.GL8399@wantadilla.lemis.com>
In-Reply-To: <20070228070904.GA63343@xor.obsecurity.org>
References:  <200702272309.l1RN9Xum011236@repoman.freebsd.org> <20070227235843.GA59138@xor.obsecurity.org> <20070228064334.GG8399@wantadilla.lemis.com> <20070228070904.GA63343@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--/ZYM6PqDyfNytx60
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wednesday, 28 February 2007 at  2:09:04 -0500, Kris Kennaway wrote:
> On Wed, Feb 28, 2007 at 05:13:34PM +1030, Greg 'groggy' Lehey wrote:
>> How would you address the case?  Recall that we're talking here about
>> two different programmers, and you don't even know who the second one
>> is.  It would be nice to have some mechanism like WITLESS to detect
>> the problem, but I can't see how it would work.
>
> Who are the two different programmers, you and who else? :-)

You're obviously one of them.  Otherwise you're not involved.  And as
I said, you don't know who the other one is.

> If there are parts of the FreeBSD kernel that are abusing a sleep
> channel to create this situation, we should fix them.

See the rest of the thread.  A "sleep channel" is a memory address.
It's usually in the kernel, so you're talking about a 30 bit address
space on ia32.  That's really not very many.

> If not, the most that should be done in the FreeBSD manpage is to
> clearly explain how not to introduce such a bug in a programmer's
> own code.

Until the advent of wakeup_one, this wasn't a bug.  wakeup works fine
under these circumstances.

> As far as I'm aware, nowhere else in our manpages do we provide
> advice for the lazy programmer who cannot be bothered figuring out
> whether his code is correct and who just wants an expedient hack in
> case it's not.

Maybe you should be a little less combative and consider that the
paradigms have changed.  The whole idea of sleeping on memory
addresses is an expedient hack.  The fact that people usually choose
different addresses means that even wakeup_one seldom has problems.
But most people aren't even aware of the issue.  As I say, how would
you address the status quo?

Greg
--
See complete headers for address and phone numbers.

--/ZYM6PqDyfNytx60
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (FreeBSD)

iD8DBQFF5TYDIubykFB6QiMRAtOkAKChIIh0h4Sj228U7eOyavuZRtETTQCeKm1B
YvmoWFikWExMx0Tu4RnZXT0=
=UeVq
-----END PGP SIGNATURE-----

--/ZYM6PqDyfNytx60--



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