From owner-p4-projects Sat Jul 27 17: 8:28 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DE32E37B401; Sat, 27 Jul 2002 17:08:22 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A5E437B400; Sat, 27 Jul 2002 17:08:22 -0700 (PDT) Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7A9D43E42; Sat, 27 Jul 2002 17:08:21 -0700 (PDT) (envelope-from bmilekic@angelica.unixdaemons.com) Received: from angelica.unixdaemons.com (bmilekic@localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.5/8.12.1) with ESMTP id g6RNn41m039262; Sat, 27 Jul 2002 19:49:04 -0400 (EDT) X-Authentication-Warning: angelica.unixdaemons.com: Host bmilekic@localhost.unixdaemons.com [127.0.0.1] claimed to be angelica.unixdaemons.com Received: (from bmilekic@localhost) by angelica.unixdaemons.com (8.12.5/8.12.1/Submit) id g6RNn4mm039253; Sat, 27 Jul 2002 19:49:04 -0400 (EDT) (envelope-from bmilekic) Date: Sat, 27 Jul 2002 19:49:04 -0400 From: Bosko Milekic To: Robert Watson Cc: Perforce Change Reviews Subject: Re: PERFORCE change 14877 for review Message-ID: <20020727194904.A38779@unixdaemons.com> References: <20020724224812.A1630@unixdaemons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from rwatson@freebsd.org on Sat, Jul 27, 2002 at 07:20:38PM -0400 Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Jul 27, 2002 at 07:20:38PM -0400, Robert Watson wrote: > > On Wed, 24 Jul 2002, Bosko Milekic wrote: > > > On Wed, Jul 24, 2002 at 07:21:38PM -0700, Robert Watson wrote: > > > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14877 > > > > > > Change 14877 by rwatson@rwatson_curry on 2002/07/24 19:21:02 > > > > > > Hopefully a bug fix for a bug whereby when one pipe end is > > > terminated, the label is prematurely destroyed, resulting in > > > a blank label during follow-up policy checks. I believe this > > > change modifies the logic so that the pipe label is destroyed > > > only when the second end-point is removed. We'll see if this > > > corrects the problem I'm bumping into. > > > > Since you have one mutex and one label for both ends of the > > bi-directional pipe, why don't you just use the code already in place > > for destroying the mutex 'safely' to also destroy the label? In > > other words, pipeclose() has this `hadpeer' variable which it > > increments if it finds that the other end exists (and the mutex is > > grabbed, then). In other words, just group the label destroy with > > the mutex destroy. If one is wrong, they're both wrong and you can > > fix them both at the same time. I think that you should only be > > destroying the label if it hasn't already been initialized, as well. > > It could be that this is a partially created pipe and so the mutex > > (and possibly the label?) have not yet been created. I would examine > > this further myself but it'll have to wait... :-( > > Yeah, I think there may be windows where for fdesc-shared processes (and > presumably KSE's), the pipe is present but not yet available. An > interesting question is whether you can perform pipe operations in the > window, and if so, whether we need to initialize the labels earlier, and > destroy them later. I'm actually looking at this today and should be able to come up with either confirmation that it's correct or a fix. What I initially thought was a problem may in fact not be, but when I come up with something, if anything, I'll send you the diff. > Robert N M Watson FreeBSD Core Team, TrustedBSD Projects > robert@fledge.watson.org Network Associates Laboratories -- Bosko Milekic bmilekic@unixdaemons.com bmilekic@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message