From owner-freebsd-current@FreeBSD.ORG Thu Mar 29 06:54:09 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C02216A401 for ; Thu, 29 Mar 2007 06:54:09 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.swip.net [212.247.154.129]) by mx1.freebsd.org (Postfix) with ESMTP id CD7CA13C44B for ; Thu, 29 Mar 2007 06:54:08 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.217.102.48] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe05.swip.net (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 350986382 for freebsd-current@freebsd.org; Thu, 29 Mar 2007 08:54:07 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Thu, 29 Mar 2007 08:53:47 +0200 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703290853.47940.hselasky@c2i.net> Subject: Panic in devfs 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: Thu, 29 Mar 2007 06:54:09 -0000 Hi, I initially forwarded this to PHK, but got no reply so I'm posting it here. I have caught a panic related to devfs while working on the new USB stack. Backtrace: uma_zalloc_arg() malloc() free_unr() devfs_free() destroy_devl() destroy_dev() ttyfree() ... ... The problem is that the lock, "devmtx", see "kern_conf.c" line 61, is locked when allocating memory. Maybe you have to call this "free_unr()" out of order? void devfs_free(struct cdev *cdev) { struct cdev_priv *cdp; cdp = cdev->si_priv; if (cdev->si_cred != NULL) crfree(cdev->si_cred); if (cdp->cdp_inode > 0) free_unr(devfs_inos, cdp->cdp_inode); XXX cannot call this here because this function allocates memory XXX if (cdp->cdp_maxdirent > 0) free(cdp->cdp_dirents, M_DEVFS2); free(cdp, M_CDEVP); } Can someone fix this and commit a patch to head, or should I make a PR out of this? --HPS