From owner-freebsd-current@FreeBSD.ORG Tue Mar 18 21:04:19 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E7D1106564A; Tue, 18 Mar 2008 21:04:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 0EAAD8FC29; Tue, 18 Mar 2008 21:04:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1Jbiyf-0000mM-Fv; Tue, 18 Mar 2008 23:04:17 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m2IL46lr015734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Mar 2008 23:04:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m2IL3rAd041640; Tue, 18 Mar 2008 23:03:53 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m2IL3reh041639; Tue, 18 Mar 2008 23:03:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 18 Mar 2008 23:03:53 +0200 From: Kostik Belousov To: Attilio Rao Message-ID: <20080318210353.GE10374@deviant.kiev.zoral.com.ua> References: <3bbf2fe10803181145m79e89955re785e1b5048cafd7@mail.gmail.com> <3bbf2fe10803181216l7a1f7a5fp382b03a74d84161f@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X/KOvfZbhhxWSrMq" Content-Disposition: inline In-Reply-To: <3bbf2fe10803181216l7a1f7a5fp382b03a74d84161f@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 81fdb9d644701462f7849401ec726e21 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 2438 [Mar 18 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {TO: local part of email appears in body} X-SpamTest-Method: none X-SpamTest-Rate: 9 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: Alex Goncharov , pluknet , freebsd-current@freebsd.org Subject: Re: Seeing lock order reversal 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: Tue, 18 Mar 2008 21:04:19 -0000 --X/KOvfZbhhxWSrMq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 18, 2008 at 08:16:28PM +0100, Attilio Rao wrote: > 2008/3/18, pluknet : > > On 18/03/2008, Attilio Rao wrote: > > > 2008/3/18, pluknet : > > > > > > > > > > Thought taking that into account I could obtain a new one yesterd= ay. I > > > > didn't see this before. > > > > > > > > Mar 17 03:17:14 pl sudo: pluknet : TTY=3Dttyv1 ; PWD=3D/usr/hom= e/pluknet > > > > ; USER=3Droot ; COMMAND=3D/usr/libexec/getty 3wire.9600 ttyd0 > > > > Mar 17 03:17:14 pl kernel: lock order reversal: > > > > Mar 17 03:17:14 pl kernel: 1st 0xc07e9274 proctree (proctree) @ > > > > /usr/src/sys/kern/kern_exit.c:291 > > > > Mar 17 03:17:14 pl kernel: 2nd 0xc2fc49e8 devfs (devfs) @ > > > > /usr/src/sys/kern/vfs_subr.c:2158 > > > > > > > > > This one seems interesting. > > > Next time you experience it can you please drop in DDB and print-out > > > the correct order revealed by WITNESS? > > > > > > > > > Fortunately I could reproduce it. > > > > lock order reversal: > > > > 1st 0xc07e9274 proctree (proctree) @ /usr/src/sys/kern/kern_exit.c:291 > > > > 2nd 0xc3c18278 devfs (devfs) @ /usr/src/sys/kern/vfs_subr.c:2158 > > KDB: stack backtrace: > > db_trace_self_wrapper(c07682d0,d6078b24,c0573236,c076a615,c3c18278,...) > > > > at db_trace_self_wrapper+0x26 > > > > kdb_backtrace(c076a615,c3c18278,c075bcfb,c075bcfb,c0770a8c,...) at > > kdb_backtrace+0x29 > > witness_checkorder(c3c18278,9,c0770a8c,86e,c07edcd4,...) at > > witness_checkorder+0x6d6 > > _lockmgr_args(c3c18278,20002,c3c182a8,0,ffffffff,...) at _lockmgr_args= +0x519 > > vop_stdlock(d6078bc4,d6078bbc,c0572a1c,20002,c3c182a8,...) at vop_stdl= ock+0x51 > > VOP_LOCK1_APV(c07a07e0,d6078bc4,851,d6078be4,c3c182a8,...) at VOP_LOCK= 1_APV+0xa5 > > _vn_lock(c3c18220,20002,c0770a8c,86e,4,...) at _vn_lock+0xf2 > > vrele(c3c18220,0,c07619a2,14e,ffffffff,...) at vrele+0x142 > > exit1(c2fdd690,0,d6078d2c,c0729ed3,c2fdd690,...) at exit1+0x8a1 > > sys_exit(c2fdd690,d6078cfc,4,c07625a5,c07a3d38,...) at sys_exit+0x1d > > syscall(d6078d38) at syscall+0x2b3 > > Xint0x80_syscall() at Xint0x80_syscall+0x20 > > --- syscall (1, FreeBSD ELF32, sys_exit), eip =3D 0x2811964f, esp =3D > > 0xbfbfeacc, ebp =3D 0xbfbfead8 --- > > > > Something else? >=20 > This is the "2nd order". > It would be nice to get where these locks are acquired and what is the > "1st order". > In order to get it, it is enough to break in DDB and do: show witness > at DDB prompt. >=20 > Thanks, > Attilio The other order comes from the devfs_close. Look at the handling of the controlling terminal at the start of the function. --X/KOvfZbhhxWSrMq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkfgLjgACgkQC3+MBN1Mb4gtswCfbmP7MlGlOPWfD96eDY8bfsqe zXgAoMbAdvf2CL/+qpA12fHHP2fE593S =zkvW -----END PGP SIGNATURE----- --X/KOvfZbhhxWSrMq--