From owner-freebsd-current@FreeBSD.ORG Thu Dec 11 20:15:08 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 5C26D16A4CE; Thu, 11 Dec 2003 20:15:08 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A1FF43D33; Thu, 11 Dec 2003 20:15:02 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id hBC4EpUd010606; Thu, 11 Dec 2003 23:14:51 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)hBC4Ep3w010603; Thu, 11 Dec 2003 23:14:51 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 11 Dec 2003 23:14:50 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Jun Kuriyama In-Reply-To: <7m7k123dci.wl@black.imgsrc.co.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Current cc: jhb@FreeBSD.org Subject: Re: vn_fullpath: 0xc85e24a0 is not locked but should be 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: Fri, 12 Dec 2003 04:15:08 -0000 On Fri, 12 Dec 2003, Jun Kuriyama wrote: > As of today's -current with SCHED_4BSD. I saved "ps" output on ddb, so > I can place it somewhere if somebody wants. > > # Why I got so many panics? :-( Ah, you're still runing with the VFS lock debugging :-). Indeed, it looks like a vn_lock() and unlock of p->p_textvp is missing in procfs_doprocfile(), even though that likely would violate the VFS lock order. The attached (untested) patch might well fix it, but might not be right -- I'm not sure that curthread holds a valid reference to p->p_textvp that can't evaporate during these operations. I'm not sure the proc reference stuff protects us properly here, but John would know (CC'd). Index: procfs.c =================================================================== RCS file: /home/ncvs/src/sys/fs/procfs/procfs.c,v retrieving revision 1.9 diff -u -r1.9 procfs.c --- procfs.c 17 Apr 2003 22:12:12 -0000 1.9 +++ procfs.c 12 Dec 2003 04:13:10 -0000 @@ -70,7 +70,9 @@ char *fullpath = "unknown"; char *freepath = NULL; + vn_lock(p->p_textvp, LK_EXCLUSIVE | LK_RETRY, td); vn_fullpath(td, p->p_textvp, &fullpath, &freepath); + VOP_UNLOCK(p->p_textvp, 0, td); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research > > ----- console > vn_fullpath: 0xc85e24a0 is not locked but should be > Debugger("Lock violation. > ") > Stopped at Debugger+0x55: xchgl %ebx,in_Debugger.0 > db> trace > Debugger(c0739a77,c0739010,c85e24a0,c0739ab8,ece05710) at Debugger+0x55 > vfs_badlock(c0739ab8,c0739010,c85e24a0,c07a38c0,c85e24a0) at vfs_badlock+0x45 > assert_vop_locked(c85e24a0,c0739010,2,246,c93e0200) at assert_vop_locked+0x62 > vn_fullpath(c8e12500,c85e24a0,ece05754,ece05758,c0750da7) at vn_fullpath+0x81 > procfs_doprocfile(c8e12500,c9c7054c,c8295e00,ece0577c,0) at procfs_doprocfile+0x3a > pfs_readlink(ece05bd0,c0739563,c0739548,a6,c8e12500) at pfs_readlink+0x11b > namei(ece05c28,c07b4bb8,c07b4b40,c07b2d00,607) at namei+0x43a > stat(c8e12500,ece05d14,c0752fc5,3ee,2) at stat+0x52 > syscall(2f,2f,2f,bfbfe270,bfbfe350) at syscall+0x2c0 > Xint0x80_syscall() at Xint0x80_syscall+0x1d > --- syscall (188, FreeBSD ELF32, stat), eip = 0x280cb47f, esp = 0xbfbfe24c, ebp = 0xbfbfe7c8 --- > db> show locks > exclusive sleep mutex Giant r = 0 (0xc07ae560) locked @ i386/i386/trap.c:1000 > db> show lockedvnods > Locked vnodes > 0xc9d1e5c8: tag pseudofs, type VLNK, usecount 1, writecount 0, refcount 0, lock type pseudofs: EXCL (count 1) by thread 0xc8e12500 (pid:19220) > > db> panic > panic: from debugger > cpuid = 1; > boot() called on cpu#1 > ACPI-0265: *** Error: Hardware never changed modes > > syncing disks, buffers remaining... VOP_LOCK: 0xc85e2250 is not locked but should be > VOP_FSYNC: 0xc85e2250 is not locked but should be > ffs_update: 0xc85e2250 is not locked but should be > VOP_FSYNC: 0xc85e2250 is not locked but should be > VOP_UNLOCK: 0xc85e2250 is not locked but should be > VOP_LOCK: 0xc85e2128 is not locked but should be > VOP_FSYNC: 0xc85e2128 is not locked but should be > ffs_update: 0xc85e2128 is not locked but should be > VOP_FSYNC: 0xc85e2128 is not locked but should be > VOP_UNLOCK: 0xc85e2128 is not locked but should be > VOP_LOCK: 0xc85e2000 is not locked but should be > VOP_FSYNC: 0xc85e2000 is not locked but should be > ffs_update: 0xc85e2000 is not locked but should be > VOP_FSYNC: 0xc85e2000 is not locked but should be > VOP_UNLOCK: 0xc85e2000 is not locked but should be > VOP_LOCK: 0xc85e36f0 is not locked but should be > VOP_FSYNC: 0xc85e36f0 is not locked but should be > ffs_update: 0xc85e36f0 is not locked but should be > VOP_FSYNC: 0xc85e36f0 is not locked but should be > VOP_UNLOCK: 0xc85e36f0 is not locked but should be > VOP_LOCK: 0xc8648378 is not locked but should be > VOP_FSYNC: 0xc8648378 is not locked but should be > ffs_update: 0xc8648378 is not locked but should be > VOP_FSYNC: 0xc8648378 is not locked but should be > VOP_UNLOCK: 0xc8648378 is not locked but should be > VOP_LOCK: 0xc8713000 is not locked but should be > VOP_FSYNC: 0xc8713000 is not locked but should be > ffs_update: 0xc8713000 is not locked but should be > VOP_FSYNC: 0xc8713000 is not locked but should be > VOP_UNLOCK: 0xc8713000 is not locked but should be > VOP_LOCK: 0xc8737250 is not locked but should be > VOP_FSYNC: 0xc8737250 is not locked but should be > ffs_update: 0xc8737250 is not locked but should be > VOP_FSYNC: 0xc8737250 is not locked but should be > VOP_UNLOCK: 0xc8737250 is not locked but should be > VOP_LOCK: 0xc8765378 is not locked but should be > VOP_FSYNC: 0xc8765378 is not locked but should be > ffs_update: 0xc8765378 is not locked but should be > VOP_FSYNC: 0xc8765378 is not locked but should be > VOP_UNLOCK: 0xc8765378 is not locked but should be > VOP_LOCK: 0xc8765250 is not locked but should be > VOP_FSYNC: 0xc8765250 is not locked but should be > ffs_update: 0xc8765250 is not locked but should be > VOP_FSYNC: 0xc8765250 is not locked but should be > VOP_UNLOCK: 0xc8765250 is not locked but should be > VOP_LOCK: 0xc87ba250 is not locked but should be > VOP_FSYNC: 0xc87ba250 is not locked but should be > ffs_update: 0xc87ba250 is not locked but should be > VOP_FSYNC: 0xc87ba250 is not locked but should be > VOP_UNLOCK: 0xc87ba250 is not locked but should be > panic: pmap_invalidate_range: interrupts disabled > cpuid = 1; > boot() called on cpu#1 > ACPI-0265: *** Error: Hardware never changed modes > Uptime: 46m47s > Dumping 2047 MB > ... > ----- > > > -- > Jun Kuriyama // IMG SRC, Inc. > // FreeBSD Project > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >