From owner-freebsd-current@FreeBSD.ORG Sun Jul 17 15:39:50 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org 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 AD4E016A41C for ; Sun, 17 Jul 2005 15:39:50 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D72143D45 for ; Sun, 17 Jul 2005 15:39:49 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-66-30-114-143.hsd1.ma.comcast.net ([66.30.114.143]) by comcast.net (rwcrmhc11) with ESMTP id <2005071715393801300rhukpe>; Sun, 17 Jul 2005 15:39:49 +0000 Received: from c-66-30-114-143.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.4/8.13.1) with ESMTP id j6HFdakc002311; Sun, 17 Jul 2005 11:39:36 -0400 (EDT) (envelope-from rodrigc@c-66-30-114-143.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.4/8.13.1/Submit) id j6HFdaXw002308; Sun, 17 Jul 2005 11:39:36 -0400 (EDT) (envelope-from rodrigc) Date: Sun, 17 Jul 2005 11:39:36 -0400 From: Craig Rodrigues To: "Wojciech A. Koszek" Message-ID: <20050717153936.GA2218@crodrigues.org> References: <20050716224442.GA87607@freebsd.czest.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050716224442.GA87607@freebsd.czest.pl> User-Agent: Mutt/1.5.9i Cc: freebsd-current@freebsd.org Subject: Re: [LOR] kqueue() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2005 15:39:50 -0000 On Sat, Jul 16, 2005 at 10:44:43PM +0000, Wojciech A. Koszek wrote: > http://FreeBSD.czest.pl/dunstan/kqueuetest.c > > Compile: > [1] gcc kqueuetest.c -o kqueuetest > Run with shell's PID: > [2] ./kqueuetest $$ > [3] Suspend execution with CTRL^Z and move task to > background: bg %1 I can reproduce this LOR: 13 0xc066291c in _mtx_assert (m=0xc1bff600, what=0, file=0xc0878298 "/usr/src/sys/kern/kern_event.c", line=1039) at /usr/src/sys/kern/kern_mutex.c:751 #14 0xc065180e in kqueue_expand (kq=0xc1bff600, fops=0x0, ident=3014, waitok=0) at /usr/src/sys/kern/kern_event.c:1039 #15 0xc0651261 in kqueue_register (kq=0xc1bff600, kev=0xd15f0c40, td=0x0, waitok=0) at /usr/src/sys/kern/kern_event.c:828 #16 0xc065068e in filt_proc (kn=0xc18af6e8, hint=0) at /usr/src/sys/kern/kern_event.c:413 #17 0xc0652644 in knote (list=0xc1b071b4, hint=1073744838, islocked=1) at /usr/src/sys/kern/kern_event.c:1548 #18 0xc0656c24 in fork1 (td=0xc1b034b0, flags=20, pages=0, procp=0xd15f0cd4) at /usr/src/sys/kern/kern_fork.c:696 #19 0xc0655bd8 in fork (td=0xc1b034b0, uap=0xd15f0d04) at /usr/src/sys/kern/kern_fork.c:96 It looks like on line 1545 of kern_event.c, we have a KQ_LOCK(kq);, and then on line 1039, the KQ_NOTOWNED(kq); assertion fails, because the lock is never released. -- Craig Rodrigues rodrigc@crodrigues.org