From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 19 07:38:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 103CB16A4CF for ; Thu, 19 Feb 2004 07:38:42 -0800 (PST) Received: from pony2pub.arc.nasa.gov (pony2pub.arc.nasa.gov [128.102.31.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A44C43D1D for ; Thu, 19 Feb 2004 07:38:42 -0800 (PST) (envelope-from jtoung@arc.nasa.gov) Received: from nren-194.arc.nasa.gov ([128.102.196.194] verified) by pony2pub.arc.nasa.gov (CommuniGate Pro SMTP 4.1.8) with ESMTP id 7502268; Thu, 19 Feb 2004 07:38:41 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Jerry Toung To: Andrey Simonenko Date: Thu, 19 Feb 2004 07:37:48 -0800 User-Agent: KMail/1.4.3 References: <200402181152.26645.jtoung@arc.nasa.gov> <20040219080521.GA439@pm514-9.comsys.ntu-kpi.kiev.ua> In-Reply-To: <20040219080521.GA439@pm514-9.comsys.ntu-kpi.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200402190737.48831.jtoung@arc.nasa.gov> cc: hackers Subject: Re: locking against myself X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jtoung@arc.nasa.gov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2004 15:38:42 -0000 Thanks a lot Andrey. On Thursday 19 February 2004 12:05 am, Andrey Simonenko wrote: > On Wed, Feb 18, 2004 at 11:52:26AM -0800, Jerry Toung wrote: > > Hello hackers, > > I am constantly getting the following message when I run my KLD: > > > > panic: lockmgr: locking against myself > > Debugger("panic") > > Stopped at=09=09Debugger+0x54:=09=09xchgl=09=09%ebx,in_Debugger.0 > > db> > > > > What could possibly cause this? > > It seem to say that I'm locking an already locked variable. > > Hello Jerry, > > According to kern/kern_lock.c:lockmgr() your proc/thread already > has an exclusive lock and it tries to obtain a recursive exclusive > lock and lock doesn't have LK_CANRECURSE flag (also you allow to > sleep in lockmng()). > > This is documented in lock(9) manual page: > > LK_EXCLUSIVE Acquire an exclusive lock. If an exclusive > =09=09 lock is already held, and LK_CANRECURSE is not > =09=09 set, the system will panic(9). --=20