From owner-cvs-src@FreeBSD.ORG Wed Feb 28 07:57:57 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14E9316A402; Wed, 28 Feb 2007 07:57:57 +0000 (UTC) (envelope-from grog@lemis.com) Received: from ext-gw.lemis.com (ext-gw.lemis.com [150.101.14.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9CFFF13C4A7; Wed, 28 Feb 2007 07:57:56 +0000 (UTC) (envelope-from grog@lemis.com) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.135]) by ext-gw.lemis.com (Postfix) with ESMTP id 8FDE2133C1B; Wed, 28 Feb 2007 18:27:55 +1030 (CST) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 8685A1AA1D3; Wed, 28 Feb 2007 18:27:55 +1030 (CST) Date: Wed, 28 Feb 2007 18:27:55 +1030 From: Greg 'groggy' Lehey To: Kris Kennaway Message-ID: <20070228075755.GL8399@wantadilla.lemis.com> References: <200702272309.l1RN9Xum011236@repoman.freebsd.org> <20070227235843.GA59138@xor.obsecurity.org> <20070228064334.GG8399@wantadilla.lemis.com> <20070228070904.GA63343@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/ZYM6PqDyfNytx60" Content-Disposition: inline In-Reply-To: <20070228070904.GA63343@xor.obsecurity.org> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 VoIP: sip:0871270137@sip.internode.on.net WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/man/man9 sleep.9 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2007 07:57:57 -0000 --/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--