From owner-freebsd-current@FreeBSD.ORG Sat Dec 13 15:23:13 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADC0B16A4CE for ; Sat, 13 Dec 2003 15:23:13 -0800 (PST) Received: from mta2-svc.business.ntl.com (mta2-svc.business.ntl.com [62.253.164.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BFD243D37 for ; Sat, 13 Dec 2003 15:23:10 -0800 (PST) (envelope-from bruce@cran.org.uk) Received: from buffy.brucec.backnet ([82.3.75.140]) by mta2-svc.business.ntl.comESMTP <20031213232308.XPOP25560.mta2-svc.business.ntl.com@buffy.brucec.backnet>; Sat, 13 Dec 2003 23:23:08 +0000 Received: from buffy.brucec.backnet (localhost.brucec.backnet [127.0.0.1]) hBDNLvJ9000716; Sat, 13 Dec 2003 23:21:58 GMT (envelope-from bruce@buffy.brucec.backnet) Received: (from bruce@localhost) by buffy.brucec.backnet (8.12.10/8.12.10/Submit) id hBDNLvJg000715; Sat, 13 Dec 2003 23:21:57 GMT (envelope-from bruce) Date: Sat, 13 Dec 2003 23:21:57 +0000 From: Bruce Cran To: Ian Dowse Message-ID: <20031213232156.GA656@buffy.brucec.backnet> References: <20031210234538.GA746@buffy.brucec.backnet> <200312131700.aa73241@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: <200312131700.aa73241@salmon.maths.tcd.ie> User-Agent: Mutt/1.4.1i cc: freebsd-current@freebsd.org Subject: Re: panic: getnewvnode: free vnode isn't X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 13 Dec 2003 23:23:13 -0000 --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Dec 13, 2003 at 05:00:47PM +0000, Ian Dowse wrote: > In message <20031210234538.GA746@buffy.brucec.backnet>, Bruce Cran writes: > >#10 0xc04bb923 in panic (fmt=0xc05f16d7 "getnewvnode: free vnode isn't") > > at /usr/src/sys/kern/kern_shutdown.c:534 > >#11 0xc0500fb5 in getnewvnode (tag=0xc05f432f "ufs", mp=0xc43f2000, vops=0x0, > > vpp=0x0) at /usr/src/sys/kern/vfs_subr.c:1004 > > Could people seeing this panic try the following patch? I haven't > thought through this in much detail, but it seems that vnodes should > be removed from the free list before being cleaned. The addition > of the VI_DOINGINACT test about a year ago probably made this panic > more likely, but I don't know why it has suddenly cropped up recently. > > Jeff, does this look reasonable to you? It seems that while most > callers of vclean() ensure that the vnode is not on the free list, > some direct users of vgone/vgonel do not (e.g. vflush, vrecycle). > This could result in a vnode being on the free list while it is > being recycled. BTW, I think we may no longer need to increment the > reference count in vclean(), and the comment about VOP_INACTIVE > before the VOP_LOCK() call is no longer accurate. > > I guess it's possible that this could also affect the sysinstall > crash, but that is probably unlikely. > The patch hasn't stopped the panics, but I've tracked down a series of actions which can trigger it fairly reliably. Firstly, the new code is run after mounting the root filesystem (once), on shutdown lots of times, once when I plug the USB Speedtouch 330 modem (ugen0) in (only if 'ppp -ddial' is already running), and twice when modem_run from the speedtouch port is run. I ran a stress test of my system, compiling world, uncompressing archives, cvsupping etc while the modem was plugged in. I unplugged the modem, plugged it back in, got the 'ugenread: no pipe' messages, ran modem_run again and ppp picked up the connection again. I then ran 'du -h /usr/src' and after a second the system paniced. -- Bruce Cran --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dmesg.0.txt" GEOM: create disk ad2 dp=0xc44c3160 ad2: 58644MB [119150/16/63] at ata1-master UDMA100 acd0: DVDROM at ata1-slave PIO4 acd1: CDRW at ata2-master PIO4 Mounting root from ufs:/dev/ad0s1a vp->v_iflag & VI_FREE is TRUE - bug fix lock order reversal 1st 0xc063dd80 dont_sleep_in_callout (dont_sleep_in_callout) @ /usr/src/sys/kern/kern_timeout.c:224 2nd 0xc063d160 allproc (allproc) @ /usr/src/sys/kern/kern_synch.c:588 Stack backtrace: Expensive timeout(9) function: 0xc04c25fc(0) 0.821557488 s sis0: Applying short cable fix (reg=f3) ipfw2 initialized, divert disabled, rule-based forwarding enabled, default to deny, logging disabled ... uhub3: port error, giving up port 2 ugen0: ALCATEL Speed Touch 330, rev 1.10/2.00, addr 2 Warning: pid 775 used static ldt allocation. See the i386_set_ldt man page for more info lock order reversal 1st 0xc459f630 vm object (vm object) @ /usr/src/sys/vm/swap_pager.c:1323 2nd 0xc066b320 swap_pager swhash (swap_pager swhash) @ /usr/src/sys/vm/swap_pager.c:1838 3rd 0xc0c36948 vm object (vm object) @ /usr/src/sys/vm/uma_core.c:873 Stack backtrace: ... ugen0: at uhub1 port 1 (addr 2) disconnected ugen0: detached ugen0: ALCATEL Speed Touch 330, rev 1.10/2.00, addr 2 ugenread: no pipe ugenread: no pipe vp->v_iflag & VI_FREE is TRUE - bug fix ugenread: no pipe ugenread: no pipe ugenread: no pipe vp->v_iflag & VI_FREE is TRUE - bug fix vp->v_iflag & VI_FREE is TRUE - bug fix panic: getnewvnode: free vnode isn't Stack backtrace: ... db> tr --G4iJoqBmSsgzjUCe--