From owner-svn-src-all@FreeBSD.ORG Sat Aug 11 10:39:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC68F1065672; Sat, 11 Aug 2012 10:39:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail26.syd.optusnet.com.au (mail26.syd.optusnet.com.au [211.29.133.167]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7598FC0C; Sat, 11 Aug 2012 10:39:46 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail26.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q7BAdhwW019765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Aug 2012 20:39:44 +1000 Date: Sat, 11 Aug 2012 20:39:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20120811181037.A853@besplex.bde.org> Message-ID: <20120811203656.K1239@besplex.bde.org> References: <201208110006.q7B06uPR092724@svn.freebsd.org> <20120811181037.A853@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu Subject: Re: svn commit: r239187 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2012 10:39:48 -0000 On Sat, 11 Aug 2012, Bruce Evans wrote: > On Sat, 11 Aug 2012, David Xu wrote: >> ... >> for (;;) { >> if (!(uq->uq_flags & UQF_UMTXQ)) >> return (0); >> - error = msleep(uq, &uc->uc_lock, PCATCH, wmesg, >> - timo == NULL ? 0 : abs_timeout_gethz(timo)); >> - if (error != EWOULDBLOCK) >> - break; >> - umtxq_unlock(&uq->uq_key); >> - if (abs_timeout_update(timo)) { >> - error = ETIMEDOUT; > ... > This follows the null pointer in abs_timeout_update() if timo == NULL. > timo == NULL has caused msleep to be called with a timeout of 0 ticks > (infinity), so EWOULDBLOCK should not normally be returned in this > case. However, I think it is always returned after the INT_MAX ticks > since a timeout of infinity is not really infinite, but just INT_MAX, > and there is no further magic for this value, so EWOULDBLOCK is > returned as usual if the timeout expires. Oops, 0 really does mean infinity for msleep(), so there is no problem unless it somehow returns EWOULDBLOCK. > ... >> + abs_timeout_update(timo); > > This still follows the null pointer, as above. Still no problem. Bruce