From owner-freebsd-current@FreeBSD.ORG Mon Apr 28 01:06:45 2008 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 176ED1065672 for ; Mon, 28 Apr 2008 01:06:45 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by mx1.freebsd.org (Postfix) with ESMTP id 11DBC8FC12 for ; Mon, 28 Apr 2008 01:06:43 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so6982204waf.3 for ; Sun, 27 Apr 2008 18:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=YGwLCPDibged/DexN0j68mnBa/z0jcxctAfnYrkw8HU=; b=Kwhi7tlUvOa7KsmEPnl1B6A7juT13fRjXVJ/Kw5uI5KNSr673nD2cbpndrnmGV8iKhJ1YIhQo6V5EGIyb335l5SmxSY4zjNtNV8xX5ZKnkSxmeo7cft6csqHM/wmR4JgccUc73nXUC/pX+0QHo2etFNznFmBa3FRVLTCAUP1c5I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=BWSJ1zFSyLP4/gW+wGVJz2xClbl2BlkzI5ajtXegPmttO6CvuZQZ/UgwkMa/pGM2IXsBABqSEOpwKifr1oT91FU1LUn+Wv5Togbh+phsxjPmgO0q/P8Ev26ZXUxK8JGNVpsZwc2p32qlMFjdHSgDbryLRuR4+vxkejtxniljWfc= Received: by 10.114.150.1 with SMTP id x1mr5846802wad.46.1209344803622; Sun, 27 Apr 2008 18:06:43 -0700 (PDT) Received: from ?192.168.10.42? ( [99.147.149.81]) by mx.google.com with ESMTPS id j38sm12816211waf.54.2008.04.27.18.06.41 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Apr 2008 18:06:42 -0700 (PDT) Message-Id: <078878C9-2A7C-4B14-81F6-0E7F9D305305@gmail.com> From: Garrett Cooper To: Garrett Cooper In-Reply-To: <17A30EF3-B488-494B-94C2-5108EC6EF07A@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v919.2) Date: Sun, 27 Apr 2008 18:07:33 -0700 References: <17A30EF3-B488-494B-94C2-5108EC6EF07A@gmail.com> X-Mailer: Apple Mail (2.919.2) Cc: current@freebsd.org Subject: Re: Panic on attempt to kern_stat / mount bad fs 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: Mon, 28 Apr 2008 01:06:45 -0000 On Apr 27, 2008, at 5:52 PM, Garrett Cooper wrote: > Trying to use more of my harddisk, I formatted 2 labels I previously =20= > fdisked on my machine (note that there wasn't a modification in MBRs =20= > or slices, just partitions). > > Later on, I was recompiling my kernel and world recently and my =20 > machine took a nose dive (panicked) partway through. The machine =20 > rebooted by itself (to my surprise) and subsequently panicked again =20= > attempting to mount one of the newly formatted filesystems. > > I quickly logged in locally, removed the 1/2 filesystems from my =20 > fstab automount list and rebooted yet again. After that, and once I =20= > removed background_fsck_enable=3DYES from rc.conf, everything appears =20= > to be smooth sailing (knock on wood). > > I have 2 vmcore's that I can debug with: one from the first panic =20 > and another from the 2nd panic. > > (I had to rebuild the kernel after I removed apcupsd as I have a USB =20= > kbd and apcupsd provides uhid -- well, sort of...). > > optimus# uname -a > FreeBSD optimus 8.0-CURRENT FreeBSD 8.0-CURRENT #14: Sun Apr 27 =20 > 17:09:22 PDT 2008 root@optimus:/usr/obj/usr/src/sys/OPTIMUS i386 > > I'll provide more info when requested. > > Thanks, > -Garrett Looks like there might be some missing error checking logic in the fs =20= area: optimus# kgdb -c /var/crash/vmcore.0 /boot/kernel.old/kernel kgdb: kvm_nlist(_stopped_cpus): kgdb: kvm_nlist(_stoppcbs): [GDB will not be able to debug user-mode threads: /usr/lib/=20 libthread_db.so: Undefined symbol "ps_pglobal_lookup"] GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and =20 you are welcome to change it and/or distribute copies of it under certain =20 conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for =20 details. This GDB was configured as "i386-marcel-freebsd". Unread portion of the kernel message buffer: panic: ufs_dirbad: /scratch: bad dir ino 2 at offset 0: mangled entry Uptime: 9d16h44m22s Physical memory: 2038 MB Dumping 250 MB: 235 219 203 187 171 155 139 123 107 91 75 59 43 27 11 #0 doadump () at pcpu.h:195 195 pcpu.h: No such file or directory. in pcpu.h (kgdb) up 10 #10 0xc062c17b in kern_stat (td=3D0xc53c5000, path=3D0xbfbfe2d4
, pathseg=3DUIO_USERSPACE, sbp=3D0xe7debc18) at = /=20 usr/src/sys/kern/vfs_syscalls.c:2109 2109 if ((error =3D namei(&nd)) !=3D 0) (kgdb) bt #0 doadump () at pcpu.h:195 #1 0xc05b52c5 in boot (howto=3D260) at /usr/src/sys/kern/=20 kern_shutdown.c:409 #2 0xc05b54d4 in panic (fmt=3DVariable "fmt" is not available. ) at /usr/src/sys/kern/kern_shutdown.c:563 #3 0xc06e2b97 in ufs_dirbad (ip=3D0x0, offset=3D0, how=3D0xc0795460 =20 "mangled entry") at /usr/src/sys/ufs/ufs/ufs_lookup.c:598 #4 0xc06e3b5c in ufs_lookup (ap=3D0xe7deba04) at /usr/src/sys/ufs/ufs/=20= ufs_lookup.c:288 #5 0xc0750f02 in VOP_CACHEDLOOKUP_APV (vop=3D0xc07d0360, a=3D0xe7deba04) = =20 at vnode_if.c:153 #6 0xc0618390 in vfs_cache_lookup (ap=3D0xe7deba84) at vnode_if.h:83 #7 0xc07528d1 in VOP_LOOKUP_APV (vop=3D0xc07d0880, a=3D0xe7deba84) at =20= vnode_if.c:99 #8 0xc061e4fc in lookup (ndp=3D0xe7debba8) at vnode_if.h:57 #9 0xc061f143 in namei (ndp=3D0xe7debba8) at /usr/src/sys/kern/=20 vfs_lookup.c:219 #10 0xc062c17b in kern_stat (td=3D0xc53c5000, path=3D0xbfbfe2d4
, pathseg=3DUIO_USERSPACE, sbp=3D0xe7debc18) at = /=20 usr/src/sys/kern/vfs_syscalls.c:2109 #11 0xc062c315 in stat (td=3D0xc53c5000, uap=3D0xe7debcfc) at = /usr/src/sys/=20 kern/vfs_syscalls.c:2093 #12 0xc073c423 in syscall (frame=3D0xe7debd38) at = /usr/src/sys/i386/i386/=20 trap.c:1008 #13 0xc0726b60 in Xint0x80_syscall () at /usr/src/sys/i386/i386/=20 exception.s:196 #14 0x00000033 in ?? () Previous frame inner to this frame (corrupt stack?) (kgdb) up #11 0xc062c315 in stat (td=3D0xc53c5000, uap=3D0xe7debcfc) at = /usr/src/sys/=20 kern/vfs_syscalls.c:2093 2093 error =3D kern_stat(td, uap->path, UIO_USERSPACE, &sb); (kgdb) p *uap $1 =3D {path_l_ =3D 0xe7debcfc "?=E2=BF=BF?=D8=BF?Z", path =3D = 0xbfbfe2d4
, path_r_ =3D 0xe7debd00 "?=D8=BF?Z", ub_l_ =3D = =20 0xe7debd00 "?=D8=BF?Z", ub =3D 0xbfbfd8d4, ub_r_ =3D 0xe7debd04 "Z"} (kgdb)=