Bug 193389

Summary: [panic] ufs_dirbad: /: bad dir
Product: Base System Reporter: sasamotikomi
Component: kernAssignee: Kirk McKusick <mckusick>
Status: Closed Works As Intended    
Severity: Affects Only Me CC: adrian, fs, mckusick, mikej, sasamotikomi, stable
Priority: ---    
Version: 10.0-RELEASE   
Hardware: i386   
OS: Any   

Description sasamotikomi 2014-09-06 12:14:48 UTC
panic: ufs_dirbad: /: bad dir ino 1777399 at offset 3072: mangled entry
pcpu.h: No such file or directory.
        in pcpu.h
(kgdb) #0  doadump (textdump=-974546816) at pcpu.h:233
#1  0xc0abca99 in kern_reboot (howto=260)
    at /usr/src/sys/kern/kern_shutdown.c:447
#2  0xc0abce5f in panic (fmt=<value optimized out>)
    at /usr/src/sys/kern/kern_shutdown.c:754
#3  0xc0d314b9 in ufs_lookup_ino (vdp=0x0, vpp=<value optimized out>,
    cnp=0xc00, dd_ino=<value optimized out>)
    at /usr/src/sys/ufs/ufs/ufs_lookup.c:773
#4  0xc0d3062a in ufs_lookup (ap=0xecf119e0)
    at /usr/src/sys/ufs/ufs/ufs_lookup.c:214
#5  0xc0fbb7c4 in VOP_CACHEDLOOKUP_APV (vop=<value optimized out>,
    a=0xecf119e0) at vnode_if.c:197
#6  0xc0b49de0 in vfs_cache_lookup (ap=0xecf11bcc) at vnode_if.h:80
#7  0xc0fbb6b4 in VOP_LOOKUP_APV (vop=<value optimized out>, a=0xecf11a68)
    at vnode_if.c:129
#8  0xc0b52c3e in lookup (ndp=0xecf11b70) at vnode_if.h:54
#9  0xc0b523cd in namei (ndp=0xecf11b70) at /usr/src/sys/kern/vfs_lookup.c:299
#10 0xc0b6792d in kern_accessat (td=<value optimized out>, flag=0, amode=0)
    at /usr/src/sys/kern/vfs_syscalls.c:2061
#11 0xc0b677a9 in sys_access (td=0xc6901620, uap=0xecf11cc8)
    at /usr/src/sys/kern/vfs_syscalls.c:2032
#12 0xc0f97929 in syscall (frame=<value optimized out>) at subr_syscall.c:134
#13 0xc0f80771 in Xint0x80_syscall ()
    at /usr/src/sys/i386/i386/exception.s:270
#14 0x00000033 in ?? ()
Previous frame inner to this frame (corrupt stack?)
Comment 1 Adrian Chadd freebsd_committer freebsd_triage 2014-09-07 02:16:54 UTC
Have you run a full fsck on the filesystem?



-a
Comment 2 sasamotikomi 2014-09-11 06:08:42 UTC
(In reply to Adrian Chadd from comment #1)
> Have you run a full fsck on the filesystem?
> 
> 
> 
> -a

Yes as in single user mode without journal, also I got this panic again, when update my pkg.
Comment 3 mikej 2014-12-12 15:32:24 UTC
I am also getting this error under current.

FreeBSD d620 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r275582: Mon Dec  8 02:36:47 UTC 2014     root@grind.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386

panic: ufs_dirbad: /: bad dir ino 8668611 at offset 12288: mangled entry

http://mail.mikej.com/core.txt.0
http://mail.mikej.com/info.0

http://mail.mikej.com/core.txt.1
http://mail.mikej.com/info.1

http://mail.mikej.com/smartctl-a.ada0
http://mail.mikej.com/dmesg.d620

I am getting DMA errors on the device though, not sure if this is a driver or disk problem.  This is a SSD device, the laptop had been running with a Seagate Momentus under windows and linux without issue.

I will swap drives tonight and see if the problem is isolated to the SSD or not and report back and perform any other suggested tasks for trouble shooting.

Now this is so odd I will mention it but I can't fathom why it would matter, but all my panics have always happened immediately after running "man".  So far no panics while running X, firefox, and a lot of other applications.

Thanks.
Comment 4 Kirk McKusick freebsd_committer freebsd_triage 2014-12-12 19:49:23 UTC
It appears that the offending directory has moved since your first run.
Could you please run the following commands to find the offending directory:

find / -xdev -inum 8668611 -print
ls -ld <output path of the above command>

find / -xdev -inum 1777399 -print
ls -ld <output path of the above command>

Also, as noted by Adrian Chadd in comment #1 include the output of a full fsck of the filesystem would be useful (after you have run the above commands).
Comment 5 mikej 2014-12-23 11:57:38 UTC
(In reply to mikej from comment #3)
> I am also getting this error under current.
> 
> FreeBSD d620 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r275582: Mon Dec  8
> 02:36:47 UTC 2014     root@grind.freebsd.org:/usr/obj/usr/src/sys/GENERIC 
> i386
> 
> panic: ufs_dirbad: /: bad dir ino 8668611 at offset 12288: mangled entry
> 
> http://mail.mikej.com/core.txt.0
> http://mail.mikej.com/info.0
> 
> http://mail.mikej.com/core.txt.1
> http://mail.mikej.com/info.1
> 
> http://mail.mikej.com/smartctl-a.ada0
> http://mail.mikej.com/dmesg.d620
> 
> I am getting DMA errors on the device though, not sure if this is a driver
> or disk problem.  This is a SSD device, the laptop had been running with a
> Seagate Momentus under windows and linux without issue.
> 
> I will swap drives tonight and see if the problem is isolated to the SSD or
> not and report back and perform any other suggested tasks for trouble
> shooting.
> 
> Now this is so odd I will mention it but I can't fathom why it would matter,
> but all my panics have always happened immediately after running "man".  So
> far no panics while running X, firefox, and a lot of other applications.
> 
> Thanks.

I have spent some time with this and isolated my problem to the SSD drive that I was using.  I have not determined why the SSD drive had caused an issue, but after installing an WD3200BEVT-00AORTO and letting the laptop churn for days I have not been able to reproduce my original problem.

Lastly, find / -xdev -inum 8668611 -print did always produce the fault, the issue was in man page directories (I don't remember the exact path).

Consider this resolved for me.

--mikej
Comment 6 Kirk McKusick freebsd_committer freebsd_triage 2014-12-23 22:00:26 UTC
Thanks for your followup. I will close this bug.
Comment 7 Kirk McKusick freebsd_committer freebsd_triage 2014-12-23 22:03:06 UTC
Submitter has determined that the panic was caused by hardware problems with disk on his system.