From owner-freebsd-current@FreeBSD.ORG Sat Oct 10 17:51:20 2009 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 7430C106568F for ; Sat, 10 Oct 2009 17:51:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id E421C8FC12 for ; Sat, 10 Oct 2009 17:51:19 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9AHpGBX011113 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Oct 2009 20:51:16 +0300 (EEST) (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.3/8.14.3) with ESMTP id n9AHpF7w084486; Sat, 10 Oct 2009 20:51:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n9AHpFaY084485; Sat, 10 Oct 2009 20:51:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Oct 2009 20:51:15 +0300 From: Kostik Belousov To: Harald Schmalzbauer Message-ID: <20091010175115.GC2259@deviant.kiev.zoral.com.ua> References: <4AD0BAFB.6020207@omnilan.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hH1sCSVFCbBgKiGT" Content-Disposition: inline In-Reply-To: <4AD0BAFB.6020207@omnilan.de> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at 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.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-current@freebsd.org Subject: Re: shutdown not working with uart console 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: Sat, 10 Oct 2009 17:51:20 -0000 --hH1sCSVFCbBgKiGT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 10, 2009 at 06:48:59PM +0200, Harald Schmalzbauer wrote: > Dear coders, >=20 > I recognized one RELENG_8 problem when trying to shutdown via serial=20 > console. While shutdown via SSH works like expected, when called via=20 > serial console it keeps hanging forever. > I compiled a debug kernel for my embedded device and got the following=20 > backtrace: > ~KDB: enter: Line break on console > [thread pid 1102 tid 100074 ] > Stopped at kdb_enter+0x3b: movl $0,kdb_why > db> bt > Tracing pid 1102 tid 100074 td 0xc36c26c0 > kdb_enter(c08aca1d,c08b61ae,d5c5e894,c35a0180,0,...) at kdb_enter+0x3b > uart_intr(c35a0100,c36c26c0,c344a900,c347b0d0,4,...) at uart_intr+0x298 > intr_event_handle(c344a900,d5c5e8ac,c36c26c0,c37a9ad0,1ce,...) at=20 > intr_event_handle+0x4b > intr_execute_handlers(c347b0d0,d5c5e8ac,0,d5c5e90c,c0852ed4,...) at=20 > intr_execute_handlers+0x48 > lapic_handle_intr(38,d5c5e8ac) at lapic_handle_intr+0x3a > Xapic_isr1() at Xapic_isr1+0x34 > --- interrupt, eip =3D 0xc05d0814, esp =3D 0xd5c5e8ec, ebp =3D 0xd5c5e90c= --- > _lockmgr_assert(c37a9ad0,1,c08d41d6,1ce,d5c5e940,...) at=20 > _lockmgr_assert+0x13e > __lockmgr_args(c37a9ad0,100000,c37a9aec,0,0,...) at __lockmgr_args+0x16b > vop_stdunlock(d5c5e9ec,0,c36c26c0,80000,c37a9a78,...) at vop_stdunlock+0x= 55 > VOP_UNLOCK_APV(c0912b40,d5c5e9ec,c091d71c,c09477e0,c37a9a78,...) at=20 > VOP_UNLOCK_APV+0x9a > _vn_lock(c37a9a78,80100,c08d4ec2,823,c08c5fec,...) at _vn_lock+0xbc > vget(c37a9a78,80100,c36c26c0,4f3,c37a9a78,...) at vget+0x61 > devfs_revoke(d5c5eaa4,d5c5eaa4,c08c2b09,157,c36cf330,...) at=20 > devfs_revoke+0x210 > exit1(c36c26c0,1,c08c78e8,ab6,3,...) at exit1+0x9ff > sigexit(c36c26c0,1,c08c78e8,a49,0,...) at sigexit+0x84 > postsig(1,64,c08cc013,df,c36cf2a8,...) at postsig+0x34d > ast(d5c5ed38) at ast+0x42f > doreti_ast() at doreti_ast+0x17 >=20 > I have no idea where the problem is, nor how to get more info. > Any help appreciated. I wondering whether I was too conservative in r195509. Please try this. diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 39b48e0..b96cdbf 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -340,10 +340,10 @@ exit1(struct thread *td, int rv) =20 if (ttyvp !=3D NULL) { sx_xunlock(&proctree_lock); - vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY); - if (ttyvp->v_type !=3D VBAD) + if (vn_lock(ttyvp, LK_EXCLUSIVE) =3D=3D 0) { VOP_REVOKE(ttyvp, REVOKEALL); - VOP_UNLOCK(ttyvp, 0); + VOP_UNLOCK(ttyvp, 0); + } sx_xlock(&proctree_lock); } } --hH1sCSVFCbBgKiGT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkrQyZMACgkQC3+MBN1Mb4gSHACglARbQ/Bc31BLaGw5AfDti9VN 6aoAoO5TSrtBfOWDKT5rvZhlrUYSntuY =46W4 -----END PGP SIGNATURE----- --hH1sCSVFCbBgKiGT--