From owner-freebsd-acpi@FreeBSD.ORG Fri Sep 24 01:34:58 2004 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E38B16A4CE; Fri, 24 Sep 2004 01:34:58 +0000 (GMT) Received: from crumpet.united-ware.com (ddsl-66-42-172-210.fuse.net [66.42.172.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 357CF43D48; Fri, 24 Sep 2004 01:34:57 +0000 (GMT) (envelope-from mistry.7@osu.edu) Received: from [192.168.0.6] (adsl-68-250-185-35.dsl.wotnoh.ameritech.net [68.250.185.35]) (authenticated bits=0)i8O1K1HR010505 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Thu, 23 Sep 2004 21:20:03 -0400 (EDT) (envelope-from mistry.7@osu.edu) From: Anish Mistry To: John Baldwin Date: Thu, 23 Sep 2004 21:36:46 -0400 User-Agent: KMail/1.7 References: <200409201501.48755.mistry.7@osu.edu> <200409211814.52805.mistry.7@osu.edu> <200409221518.00328.jhb@FreeBSD.org> In-Reply-To: <200409221518.00328.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1156537.TaMmmeu2YT"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200409232136.54285.mistry.7@osu.edu> X-Spam-Status: No, hits=0.8 required=5.0 tests=BIZ_TLD autolearn=no version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on crumpet.united-ware.com cc: freebsd-acpi@freebsd.org cc: Poul-Henning Kamp Subject: Re: RELENG_5 panic: mtx_lock() with ACPI X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2004 01:34:58 -0000 --nextPart1156537.TaMmmeu2YT Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 22 September 2004 03:18 pm, John Baldwin wrote: > On Tuesday 21 September 2004 06:14 pm, Anish Mistry wrote: > > On Tuesday 21 September 2004 03:26 pm, you wrote: > > > On Tuesday 21 September 2004 03:05 pm, Anish Mistry wrote: > > > > On Monday 20 September 2004 04:00 pm, you wrote: > > > > > Anish Mistry wrote: > > > > > > On Monday 20 September 2004 03:35 pm, you wrote: > > > > > >>Anish Mistry wrote: > > > > > >>>On Monday 20 September 2004 03:01 pm, Anish Mistry wrote: > > > > > >>>>I'm getting the following panic on boot only with ACPI enable= d. > > > > > >>>>On a verbose boot right after: start_init: trying /sbin/init > > > > > >>>>panic: mtx_lock() of spin mutex(null) @ > > > > > >>>> /usr/src/sys/tty/tty.c:2809 Can't seem to get a dump even if > > > > > >>>> dumpdev is set at the loader prompt. > > > > > >>>> > > > > > >>>>Verbose boot without ACPI enabled and ASL attached. > > > > > >>> > > > > > >>>Attachments got stripped. > > > > > >>>http://am-productions.biz/debug/BIGGUY-dmesg.txt.gz > > > > > >>>http://am-productions.biz/debug/bigguy.asl.gz > > > > > >> > > > > > >>Can you send a backtrace ("tr" from ddb)? > > > > > > > > > > > > It doesn't break to the ddb prompt. > > > > > > > > > > Can you enable options DDB? If ddb is enabled, all panics should > > > > > break to the debugger. > > > > > > > > Ok, I removed WITNESS and INVARIANTS from my kernel config, and now > > > > it's dropping to a db> prompt. > > > > > > You want to keep INVARIANTS as it find problems sooner and in easier = to > > > debug locations. Can you turn INVARIANTS back on at least and then g= et > > > a trace? > > > > > > > BTW, is there a way to set the dump device at the loader that works. > > > > > > Not that I'm aware of. > > > > With INVARIANTS enabled: > > panic: mtx_lock() of spin mutex(null) @ /usr/src/sys/tty/tty.c:2809 > > KDB: enter: panic > > [thread 100063] > > Stopped at kdb_enter+0x2c: leave > > kdb_enter(c06288da,100,af9,c062c3f3,0) at kdb_enter+0x2c > > _mtx_lock_flags(c0680f80,0,c062c3f4,af9,d0c3bb60) at _mtx_lock_flags+0x= 82 > > sysctl_kern_ttys(c065a160,0,0,d0c3bc04,c065a160) at sysctl_kern_ttys+0x= 22 > > sysctl_root(2,d0c3bc04,c13f04b0,1,0) at sysctl_root+0x83 > > userland_sysctl(c13f04b0,d0c3bc80,2,0,bfbfe4ac,0,0,0,d0c3bc7c,c067bdc0,= 0, > >c0 62929c,4e7) at userland_sysctl+0xd8 > > __sysctl(c13f04b0,d0c3db14,6,0,292) at __sysctl+0x78 > > syscall(2f,2f,2f,2,bfbfe4ac) at syscall+0x127 > > Xint0x80_syscall() at Xint0x80_syscall+0x1f > > -- syscall (202, FreeBSD ELF32, __sysctl), eip=3D0x280cb7c3, > > esp=3D0xbfbfe41c, ebp+0xbfbfe458 > > Looks like the ttys_list_mutex is busted. Hmm: > > struct tty * > ttymalloc(struct tty *tp) > { > static int once; > > if (!once) { > mtx_init(&tty_list_mutex, "ttylist", NULL, MTX_DEF); > once++; > } > > This code is not MP safe as multiple processors could attempt to call > mtx_init() twice. The mutex should probably be initialized via MTX_SYSIN= IT > instead. An alternative fix might be to change the code to work like thi= s: > > if (once !=3D 2) { > if (atomic_cmpset_int(&once, 0, 1)) { > mtx_init(...); > atomic_store_rel_int(&once, 2); > } else while (once !=3D 2) > cpu_spinwait(); > } > > To ensure that 1) only one CPU can do the mtx_init() at a time and 2) that > if any other CPU enters the function while another CPU is doing the > mtx_init() it will wait until the mutex is initialized before proceeding. Any futher progress on this that I could test out? =2D-=20 Anish Mistry --nextPart1156537.TaMmmeu2YT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBU3o2xqA5ziudZT0RAtxHAJ42+nH7o6zSTj1L9ceYUEWkD8uFqACfXy3E NKbVwCHA2KlE5VxOLCAINYw= =O/r0 -----END PGP SIGNATURE----- --nextPart1156537.TaMmmeu2YT--