From owner-freebsd-current Thu Jul 11 15:39:36 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 3C98F37B40D for ; Thu, 11 Jul 2002 15:39:31 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 376CA43E65 for ; Thu, 11 Jul 2002 15:39:30 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.5/8.12.5) with ESMTP id g6BMdNwr012080 for ; Thu, 11 Jul 2002 15:39:27 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200207112239.g6BMdNwr012080@gw.catspoiler.org> Date: Thu, 11 Jul 2002 15:39:23 -0700 (PDT) From: Don Lewis Subject: Re: "pipe mutex" vs. "sigio lock" lock order reversal To: current@FreeBSD.ORG In-Reply-To: <200207111222.g6BCMawr010506@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii 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 On 11 Jul, Don Lewis wrote: > On 7 Jul, Don Lewis wrote: >> Jul 7 07:47:09 scratch kernel: lock order reversal >> Jul 7 07:47:09 scratch kernel: 1st 0xcabf7980 pipe mutex (pipe mutex) @ /usr/src/sys/kern/sys_pipe.c:451 >> Jul 7 07:47:09 scratch kernel: 2nd 0xc0474300 sigio lock (sigio lock) @ /usr/src/sys/kern/kern_sig.c:2113> > > I figured out part of the problem. The call stack is: > > pgsigio() > pipe_read() > dofileread() > read() > > This was a bit tricky to find because the call to pgsigio() is hidden > in pipeselwakeup(), which is an inline function called by pipe_read(). > > I don't see a good way to fix this. I also don't yet know why > witness thinks it has seen the locks asserted in the opposite order. I got the serial console stuff set up and did a "show witness" to find the conflicting lock order: sigio -> process group -> process -> filedesc -> pipe I think the best fix is to defer calling pgsigio until after the pipe lock is released, but this looks like a messy change. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message