From owner-freebsd-current@FreeBSD.ORG Sun Sep 13 17:56:23 2009 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 670D51065702 for ; Sun, 13 Sep 2009 17:56:23 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id 190A68FC12 for ; Sun, 13 Sep 2009 17:56:23 +0000 (UTC) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id n8DHwecK030166 for ; Sun, 13 Sep 2009 13:58:40 -0400 (EDT) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: current Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-lOLXBp79x3seoXBE2Ez1" Organization: FreeBSD, Inc. Date: Sun, 13 Sep 2009 13:56:25 -0400 Message-Id: <1252864585.97925.139.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: Subject: Removing a USB stick locks up GEOM 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: Sun, 13 Sep 2009 17:56:23 -0000 --=-lOLXBp79x3seoXBE2Ez1 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable If I insert a USB stick with a FAT FS, and mount it, then remove it without unmounting, trying to retrieve kern.geom.conftxt will result in a live lock of the system. Yes, I know this is not a good thing to do, but I thought one of the goals of new USB was to avoid problems with doing such bad things. I'm conducting tests with: FreeBSD lasagna.marcuscom.com 9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sat Sep 12 20:51:29 EDT 2009 marcus@lasagna.marcuscom.com:/usr/obj/usr/src/sys/LASAGNA amd64 The biggest impact of this is hal causes the system to become unusable since hal uses this sysctl to obtain disk information. As soon as hald receives the devd event saying the disk is gone, it tries to refresh its disk list, and then hangs with this stack trace: #0 sched_switch (td=3D0xffffff0001a15a80, newtd=3D0xffffff0001374380, flags=3DVariable "flags" is not available. ) at /usr/src/sys/kern/sched_ule.c:1864 #1 0xffffffff802f370f in mi_switch (flags=3D260, newtd=3D0x0) at /usr/src/sys/kern/kern_synch.c:449 #2 0xffffffff80325bd2 in sleepq_timedwait (wchan=3D0xffffff00250d7100, pri=3D76) at /usr/src/sys/kern/subr_sleepqueue.c:623 #3 0xffffffff802f3c88 in _sleep (ident=3D0xffffff00250d7100, lock=3D0x0, priority=3DVariable "priority" is not available. ) at /usr/src/sys/kern/kern_synch.c:230 #4 0xffffffff8028c11a in g_waitfor_event (func=3DVariable "func" is not available. ) at /usr/src/sys/geom/geom_event.c:359 #5 0xffffffff8028d739 in sysctl_kern_geom_conftxt (oidp=3DVariable "oidp" is not available. ) at /usr/src/sys/geom/geom_kern.c:184 #6 0xffffffff802f4e58 in sysctl_root (oidp=3DVariable "oidp" is not available. ) at /usr/src/sys/kern/kern_sysctl.c:1418 #7 0xffffffff802f6101 in userland_sysctl (td=3D0x0, name=3D0xffffff804d278aa0,=20 namelen=3D3, old=3D0x0, oldlenp=3DVariable "oldlenp" is not available. ) at /usr/src/sys/kern/kern_sysctl.c:1522 #8 0xffffffff802f62da in __sysctl (td=3D0xffffff0001a15a80,=20 uap=3D0xffffff804d278bf0) at /usr/src/sys/kern/kern_sysctl.c:1448 This problem isn't 100% reproducible with hal, and I have yet to be able to reproduce it without hal. I suspect a timing issue. And it wouldn't be hard to add a sleep between the devd event and the sysctl poll, but I was hoping someone might have an idea of how to fix this in the kernel. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-lOLXBp79x3seoXBE2Ez1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAkqtMkcACgkQb2iPiv4Uz4dL8gCfRLStHHcrDY/iFYz8n45teLY2 r+gAnjG0dv3MsVkBMC1lzAUPhqcwh1RE =g+2Q -----END PGP SIGNATURE----- --=-lOLXBp79x3seoXBE2Ez1--