From owner-freebsd-current@FreeBSD.ORG Wed Aug 15 18:52:07 2007 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 DE22716A419 for ; Wed, 15 Aug 2007 18:52:07 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id 6CB9D13C478 for ; Wed, 15 Aug 2007 18:52:07 +0000 (UTC) (envelope-from max@love2party.net) Received: from [88.64.185.41] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), id 0ML25U-1ILNyO0Cnz-0000ly; Wed, 15 Aug 2007 20:52:04 +0200 From: Max Laier Organization: FreeBSD To: "Rong-en Fan" Date: Wed, 15 Aug 2007 20:51:50 +0200 User-Agent: KMail/1.9.7 References: <6eb82e0708111122g7e36b725h19ede889e4bbc9d6@mail.gmail.com> <200708112129.29751.max@love2party.net> <6eb82e0708150852t354e0a55h674d168ccee1f750@mail.gmail.com> In-Reply-To: <6eb82e0708150852t354e0a55h674d168ccee1f750@mail.gmail.com> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2244228.rqKCzGaHZH"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200708152052.01275.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1+UyA++sQSCM8mMK2wzfUTIDgxbEDY+Z5GoVDq fULc9btjR/h2NMDfyGcWdrN4e5Iwfanv9VMxtv1TXBH8wvN8iI 2CUzYPeDJxqx5tXvsfzBCF6n4Fe3W1MTt0h7FVO2ak= Cc: freebsd-current@freebsd.org, Kris Kennaway Subject: Re: panic: sleeping thread owns a non-sleepable lock 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: Wed, 15 Aug 2007 18:52:08 -0000 --nextPart2244228.rqKCzGaHZH Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 15 August 2007, Rong-en Fan wrote: > On 8/12/07, Max Laier wrote: > > On Saturday 11 August 2007, Kris Kennaway wrote: > > > On Sun, Aug 12, 2007 at 02:22:35AM +0800, Rong-en Fan wrote: > > > > I'm running 7.0-CURRENT as of yesterday, and it's very easy > > > > to make it panic: > > > > > > > > Sleeping thread (tid 100065, pid 1066) owns a non-sleepable lock > > > > sched_switch(c50a1600,0,1,1c7a7e4,4217e5,...) at > > > > sched_switch+0x190 mi_switch(1,0) at mi_switch+0x13f > > > > sleepq_switch(c50a1600,0,c078a4e2,21b,c07e3820,...) at > > > > sleepq_switch+0x87 sleepq_wait(c07e3820,0,c0770b7e,3,0,...) at > > > > sleepq_wait+0x36 _sx_xlock_hard(c07e3820,c50a1600,0,0,0,...) at > > > > _sx_xlock_hard+0x21d > > > > fr_checknatout(f9c7a8d0,f9c7a8cc,64,c57ad900,c4de7400,...) at > > > > fr_checknatout+0x29d > > > > fr_check(c8cc4644,14,c4de7400,1,f9c7a9b4,...) at fr_check+0x9b1 > > > > fr_check_wrapper(0,f9c7a9b4,c4de7400,2,c54dab28,...) at > > > > fr_check_wrapper+0x3f > > > > pfil_run_hooks(c08057c0,f9c7aa4c,c4de7400,2,c54dab28,...) at > > > > pfil_run_hooks+0x74 ip_output(c8cc4600,0,f9c7aa10,0,0,...) at > > > > ip_output+0x913 > > > > tcp_output(cae322d0,cb277200,0,0,0,...) at tcp_output+0x1106 > > > > tcp_usr_send(c51e7318,0,cb277200,0,0,...) at tcp_usr_send+0x240 > > > > kern_sendfile(c50a1600,f9c7acfc,0,0,0,...) at > > > > kern_sendfile+0x1037 > > > > sendfile(c50a1600,f9c7acfc,20,16,f9c7ad2c,...) at sendfile+0xa8 > > > > syscall(f9c7ad38) at syscall+0x315 > > > > Xint0x80_syscall() at Xint0x80_syscall+0x20 > > > > --- syscall (393, FreeBSD ELF32, sendfile), eip =3D 0x28290bff, esp > > > > =3D 0xbfbfc6ac, ebp =3D 0xbfbfe718 --- > > > > > > What is the lock it holds, and where is it acquired? > > > > My bet is on the pfil rwlock - accquired in pfil_run_hooks and > > tcbinfo / inp mtxs from tcp_output. Nothing in the transmission path > > must use sx locks. I keep on telling that. > > I compiled kernel with WITNESS and INVARIANTS as in GENERIC. > After boot, without doing anything (I even set ipnat_enable=3D"NO", i.e. > only ipfw is running, but ipf/ipnat is compiled in). I got panic. > I don't have serial console attached, but the console screen is at > > http://www.rafan.org/tmp/pfil_panic.jpg > > You can find 'show locks', 'show allpcpu', and 'show lock' for each > lock. Also two trace for thread that are found in 'show allpcpu'. > > If necessary, I can setup serial console, but it will take few days. The problem is understood and has been reported to the ipfilter=20 maintainer. One sollution might be to use rwlocks instead, but if there=20 is a path that sleeps with the lock held another sollution might be=20 required. Most likely the ioctl path (on copyin/copyout) exercises that=20 problem. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2244228.rqKCzGaHZH Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBGw0tRXyyEoT62BG0RAoeQAJ97nN4aCD5DdRmZtXx2wNqSKGRtTQCfb3r4 +sqG438eBEW+BDdE0hbYzbg= =wTwY -----END PGP SIGNATURE----- --nextPart2244228.rqKCzGaHZH--