From owner-freebsd-current Mon Nov 18 12:18:18 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 44E5437B401; Mon, 18 Nov 2002 12:18:17 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03A4243E8A; Mon, 18 Nov 2002 12:18:17 -0800 (PST) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 109A0AE2E4; Mon, 18 Nov 2002 12:18:08 -0800 (PST) Date: Mon, 18 Nov 2002 12:18:08 -0800 From: Alfred Perlstein To: Kris Kennaway Cc: current@FreeBSD.ORG, tanimura@FreeBSD.ORG Subject: Re: Lock order reversals in sys_pipe.c and kern_sig.c Message-ID: <20021118201808.GB16066@elvis.mu.org> References: <20021118190819.GK12906@rot13.obsecurity.org> <20021118193901.GA16066@elvis.mu.org> <20021118200229.GA24837@rot13.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021118200229.GA24837@rot13.obsecurity.org> User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Kris Kennaway [021118 12:01] wrote: > On Mon, Nov 18, 2002 at 11:39:01AM -0800, Alfred Perlstein wrote: > > > Well now they are, I will investigate as time permits. > > Thanks. > > > I'm still in a holding pattern about adding more debugging info to > > lockd now that we're in release candidate mode. I may ask for a > > branch to be done, but i'm not sure yet. > > Feel free to give me non-committed patches to test :-) GRR, witless always gives me the locations of the correct lock order, never the locations of the incorrect ones, so here, try this and give me a backtrace, it should nail you with extreme prejudice when you get what i think is the wrong order: Index: pipe.h =================================================================== RCS file: /home/ncvs/src/sys/sys/pipe.h,v retrieving revision 1.20 diff -u -r1.20 pipe.h --- pipe.h 14 Aug 2002 01:04:43 -0000 1.20 +++ pipe.h 18 Nov 2002 20:13:13 -0000 @@ -112,7 +112,11 @@ }; #define PIPE_MTX(pipe) (pipe)->pipe_mtxp -#define PIPE_LOCK(pipe) mtx_lock(PIPE_MTX(pipe)) +#define PIPE_LOCK(pipe) \ + do { \ + mtx_lock(PIPE_MTX(pipe)); \ + mtx_assert(&sigio_lock, MA_NOTOWNED); \ + } while (0) #define PIPE_UNLOCK(pipe) mtx_unlock(PIPE_MTX(pipe)) #define PIPE_LOCK_ASSERT(pipe, type) mtx_assert(PIPE_MTX(pipe), (type)) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message