Subject: kern/32301: Kernel crashes under high I/O load
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Matthias Scheler <tron@zhadum.org.uk>
List: netbsd-bugs
Date: 12/14/2005 11:50:00
>Number:         32301
>Category:       kern
>Synopsis:       Kernel crashes under high I/O load
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 14 11:50:00 +0000 2005
>Originator:     tron@zhadum.org.uk
>Release:        NetBSD 3.99.14 2005-12-14 sources
>Organization:
Matthias Scheler                                  http://scheler.de/~matthias/
>Environment:
System: NetBSD lyssa.zhadum.org.uk 3.99.14 NetBSD 3.99.14 (LYSSA) #0: Wed Dec 14 09:58:39 GMT 2005 tron@lyssa.zhadum.org.uk:/src/sys/compile/LYSSA i386
Architecture: i386
Machine: i386
>Description:
Ever since the read ahead changes in NetBSD 3.99.13 my machine has been
unstable under high I/O load. Before PR kern/32224 was fixed I couldn't
create crash dumps properly, now I can. Here is the stack trace from
the latest crash:

(gdb) target kcore netbsd.6.core
panic: lockmgr: sleep/spin mismatch
#0  0xc066a000 in ?? ()
(gdb) where
#0  0xc066a000 in ?? ()
#1  0xc037385e in cpu_reboot (howto=260, bootstr=0x0)
    at /usr/src/sys/arch/i386/i386/machdep.c:752
#2  0xc02f7ed8 in panic (
    fmt=0xc04c5540 "wdc_exec_command: polled command not done")
    at /usr/src/sys/kern/subr_prf.c:244
#3  0xc01cc89f in wdc_exec_command (drvp=0xc2bfc2b8, ata_c=0xcdcfba14)
    at /usr/src/sys/dev/ic/wdc.c:1312
#4  0xc0398cf5 in wd_flushcache (wd=0xc2c37000, flags=16)
    at /usr/src/sys/dev/ata/wd.c:1773
#5  0xc0398db5 in wd_shutdown (arg=0xc2c37000)
    at /usr/src/sys/dev/ata/wd.c:1796
#6  0xc02e74e5 in doshutdownhooks () at /usr/src/sys/kern/kern_subr.c:520
#7  0xc0373793 in cpu_reboot (howto=260, bootstr=0x0)
    at /usr/src/sys/arch/i386/i386/machdep.c:755
#8  0xc02f7ed8 in panic (fmt=0xc04d2aa0 "lockmgr: locking against myself")
    at /usr/src/sys/kern/subr_prf.c:244
#9  0xc02d7040 in lockmgr (lkp=0xd5e91ba8, flags=65554, interlkp=0xd5e91b38)
    at /usr/src/sys/kern/kern_lock.c:905
#10 0xc032bdad in genfs_lock (v=0xcdcfbb34)
    at /usr/src/sys/miscfs/genfs/genfs_vnops.c:300
#11 0xc032aba1 in VOP_LOCK (vp=0xd5e91b38, flags=65554)
    at /usr/src/sys/kern/vnode_if.c:1228
#12 0xc03284d5 in vn_lock (vp=0xd5e91b38, flags=65554)
    at /usr/src/sys/kern/vfs_vnops.c:722
#13 0xc031f63c in vget (vp=0xd5e91b38, flags=65554)
    at /usr/src/sys/kern/vfs_subr.c:1203
#14 0xc026a349 in ffs_sync (mp=0xc270d000, waitfor=2, cred=0xcc7c0a2c, 
    l=0xcdcacadc) at /usr/src/sys/ufs/ffs/ffs_vfsops.c:1332
#15 0xc0322829 in sys_sync (l=0xcdcacadc, v=0x0, retval=0x0)
    at /usr/src/sys/kern/vfs_syscalls.c:653
#16 0xc03209f9 in vfs_shutdown () at /usr/src/sys/kern/vfs_subr.c:2227
#17 0xc0373872 in cpu_reboot (howto=256, bootstr=0x0)
    at /usr/src/sys/arch/i386/i386/machdep.c:738
#18 0xc02f7ed8 in panic (fmt=0xc0499552 "lockmgr: sleep/spin mismatch")
    at /usr/src/sys/kern/subr_prf.c:244
#19 0xc02d7040 in lockmgr (lkp=0xd5db4bd4, flags=1, interlkp=0x0)
    at /usr/src/sys/kern/kern_lock.c:905
#20 0xc031e2f6 in vfs_busy (mp=0xd5db4bbc, flags=0, interlkp=0x0)
    at /usr/src/sys/kern/vfs_subr.c:325
#21 0xc031dcd0 in lookup (ndp=0xcdcfbeb4) at /usr/src/sys/kern/vfs_lookup.c:701
#22 0xc031d43f in namei (ndp=0xcdcfbeb4) at /usr/src/sys/kern/vfs_lookup.c:279
#23 0xc03276ea in vn_open (ndp=0xcdcfbeb4, fmode=1539, cmode=420)
    at /usr/src/sys/kern/vfs_vnops.c:132
#24 0xc032348a in sys_open (l=0xcdcacadc, v=0xcdcfbf64, retval=0xcdcfbf5c)
    at /usr/src/sys/kern/vfs_syscalls.c:1136
#25 0xc037c187 in syscall_plain (frame=0xcdcfbfa8)
    at /usr/src/sys/arch/i386/i386/syscall.c:160

>How-To-Repeat:
Use "cvs update" or "rsync", not sure where in the process it crashed.

>Fix:
None provided.