From owner-freebsd-current@FreeBSD.ORG Wed Mar 4 17:34:41 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48A611065670 for ; Wed, 4 Mar 2009 17:34:41 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: from web63902.mail.re1.yahoo.com (web63902.mail.re1.yahoo.com [69.147.97.117]) by mx1.freebsd.org (Postfix) with SMTP id E3A6D8FC12 for ; Wed, 4 Mar 2009 17:34:40 +0000 (UTC) (envelope-from barney_cordoba@yahoo.com) Received: (qmail 80326 invoked by uid 60001); 4 Mar 2009 17:34:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1236188080; bh=cFKCFzGImp4ETAes69jClSL6CBFNeN3UaNI9A8xrpOw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=4zfgBHzIxCE6smmMumaOaEnDW4iTvGiNKJcB9QWp9+gsDED5ET4B1FRbNujenu5SG6rqINC3PI9LyBCyplXf/DB/yN/gBTDnrsNP4Uc2wbbKIDFsBxTmCNKjGfZpaXxoGLzhZKSQFABbg8LO1tl0W/7+yHUFD7yeu1h3gPbv3QE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=t2J3d5TF5XrwUyOY4umQ+lDj/wRKVXgwoJYXMOgg6uYXrF+CkrYxB8innl0mvfr5HpGXiBfndIfWuk+l2Qh/xZpxam6c+XuYSWz8C4dve77KOFf5CKDoHXPcsK78besfXo0hafdHsqeip0OFmwIrzIJmMhDuuHnHrZy4JVJW+2c=; Message-ID: <415008.75717.qm@web63902.mail.re1.yahoo.com> X-YMail-OSG: 3RtEjTsVM1mkclEDc2kIQ25H4bfARtJoo2HpvnwvQpWw4Sl_kukLNfkVECcVy8lvDU4_153h26lTDfDLsuJvZVArVwhpZJBor5b56YtxD28ITVe.fizC33kKdp_dPMGitB_DuSit4uDM.XjXt1KzIxWrHceo5JvMI9M3h1YNCTrJLK1W_ekPbp.WlGo8kNk_yt3995aO.EQ08PEpJ8ZSbi7iRvfaM4u.I_zll1ibo.sETixLqCs- Received: from [98.242.222.229] by web63902.mail.re1.yahoo.com via HTTP; Wed, 04 Mar 2009 09:34:40 PST X-Mailer: YahooMailWebService/0.7.289.1 Date: Wed, 4 Mar 2009 09:34:40 -0800 (PST) From: Barney Cordoba To: jhb@freebsd.org In-Reply-To: <200903041013.22496.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: current@freebsd.org Subject: Re: MTX Lock implementation question X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: barney_cordoba@yahoo.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2009 17:34:41 -0000 --- On Wed, 3/4/09, John Baldwin wrote: > From: John Baldwin > Subject: Re: MTX Lock implementation question > To: freebsd-current@freebsd.org, barney_cordoba@yahoo.com > Cc: current@freebsd.org > Date: Wednesday, March 4, 2009, 10:13 AM > On Wednesday 04 March 2009 7:54:32 am Barney Cordoba wrote: > > > > Suppose the following: > > > > Module foo.c > > > > foo_getlock(sc) > > { > > FOO_LOCK(sc); > > } > > foo_unlock(sc) > > { > > FOO_UNLOCK(sc); > > } > > foo_dosomething(sc) > > { > > MTX_LOCK_ASSERT(sc); > > foo_dooit(); > > } > > > > Module bar.c > > > > bar_dofoo() > > { > > foo_getlock(sc); > > foo_dosomething(sc); > > foo_unlock(sc); > > } > > This works fine. > > > Is this something that shouldn't work? I need to > access functions > > that require locks in a different module, but this > code barfs on > > ASSERT with witness enabled. Is this a deflugalty in > WITNESS, or do > > I need to create functions within foo that do the > locking? Its been > > working ok for awhile (its not a high volume function) > but when I > > fired up witness to debug something else I encountered > witness panics. > > You probably have a real bug that WITNESS is warning about > however. > > -- > John Baldwin It seems that theres a problem when the mutex is initialized with a type of NULL. Changing it to a non-null string eliminated the issue. I'm running a 7.0 base system. Barney