Subject: kern/9944: panic: lockmgr: locking against myself
To: None <tech-kern@netbsd.org>
From: Tom Spindler <dogcow@redback.com>
List: tech-kern
Date: 05/01/2000 20:15:13
Lately, I've been seeing a rash of 'locking against myself panics'
with heavy nfs activity. It's been rather amazingly consistent with
this particular crash; two different coredumps show the same exact
sequence of calls, if not exactly the same data.

Here's a backtrace from a kernel built with symbols. Kernel and core
availible on request.

#0  0xc013bf45 in lockstatus (lkp=0xd2492bc0)
    at ../../../../kern/kern_lock.c:154
#1  0xc020c4bf in cpu_reboot (howto=256, bootstr=0x0)
    at ../../../../arch/i386/i386/machdep.c:1353
#2  0xc0148191 in panic (fmt=0xc013bf45 "lockmgr: locking against myself")
    at ../../../../kern/subr_prf.c:212
#3  0xc013c2d2 in lockmgr (lkp=0xd2372ddc, flags=65538, interlkp=0xd23ea844)
    at ../../../../kern/kern_lock.c:328
#4  0xc01f7332 in ufs_lock (v=0xd2492c00)
    at ../../../../ufs/ufs/ufs_vnops.c:1585
#5  0xc0165fcb in vn_lock (vp=0xd23ea7b4, flags=65538)
    at ../../../../sys/vnode_if.h:724
#6  0xc015ff76 in vrele (vp=0xd23ea7b4) at ../../../../kern/vfs_subr.c:948
#7  0xc01c9fc7 in nfs_lookup (v=0xd2492d74) at ../../../../nfs/nfs_vnops.c:822
#8  0xc015eb64 in lookup (ndp=0xd2492edc) at ../../../../sys/vnode_if.h:71
#9  0xc015e853 in namei (ndp=0xd2492edc) at ../../../../kern/vfs_lookup.c:153
#10 0xc0165440 in vn_open (ndp=0xd2492edc, fmode=1, cmode=0)
    at ../../../../kern/vfs_vnops.c:127
#11 0xc016278a in sys_open (p=0xd25769e4, v=0xd2492f88, retval=0xd2492f80)
    at ../../../../kern/vfs_syscalls.c:939
#12 0xc0213682 in syscall (frame={tf_es = 31, tf_ds = -1078001633, 
      tf_edi = 34680, tf_esi = 95496, tf_ebp = -1077949872, tf_ebx = 357023, 
      tf_edx = 0, tf_ecx = 115299, tf_eax = 5, tf_trapno = 3, tf_err = 2, 
      tf_eip = 1074284471, tf_cs = 23, tf_eflags = 582, tf_esp = -1077949908, 
      tf_ss = 31, tf_vm86_es = 0, tf_vm86_ds = 0, tf_vm86_fs = 0, 
      tf_vm86_gs = 0}) at ../../../../arch/i386/i386/trap.c:782

gdb) up
#1  0xc020c4bf in cpu_reboot (howto=256, bootstr=0x0)
    at ../../../../arch/i386/i386/machdep.c:1353
1353                    dumpsys();
(gdb) up
#2  0xc0148191 in panic (fmt=0xc013bf45 "lockmgr: locking against myself")
    at ../../../../kern/subr_prf.c:212
212             cpu_reboot(bootopt, NULL);
(gdb) up
#3  0xc013c2d2 in lockmgr (lkp=0xd2372ddc, flags=65538, interlkp=0xd23ea844)
    at ../../../../kern/kern_lock.c:328
328                                             panic("lockmgr: locking against myself");
(gdb) up
#4  0xc01f7332 in ufs_lock (v=0xd2492c00)
    at ../../../../ufs/ufs/ufs_vnops.c:1585
1585            return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, &vp->v_interlock));
(gdb) up
#5  0xc0165fcb in vn_lock (vp=0xd23ea7b4, flags=65538)
    at ../../../../sys/vnode_if.h:724
724             return (VCALL(vp, VOFFSET(vop_lock), &a));
(gdb) 
#6  0xc015ff76 in vrele (vp=0xd23ea7b4) at ../../../../kern/vfs_subr.c:948
948             if (vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK) == 0)
(gdb) 
#7  0xc01c9fc7 in nfs_lookup (v=0xd2492d74) at ../../../../nfs/nfs_vnops.c:822
822                             vrele(newvp);
(gdb) 
#8  0xc015eb64 in lookup (ndp=0xd2492edc) at ../../../../sys/vnode_if.h:71
71              return (VCALL(dvp, VOFFSET(vop_lookup), &a));
(gdb) 
#9  0xc015e853 in namei (ndp=0xd2492edc) at ../../../../kern/vfs_lookup.c:153
153                     if ((error = lookup(ndp)) != 0) {
(gdb) 
#10 0xc0165440 in vn_open (ndp=0xd2492edc, fmode=1, cmode=0)
    at ../../../../kern/vfs_vnops.c:127
127                     if ((error = namei(ndp)) != 0)
(gdb) 
#11 0xc016278a in sys_open (p=0xd25769e4, v=0xd2492f88, retval=0xd2492f80)
    at ../../../../kern/vfs_syscalls.c:939
939             if ((error = vn_open(&nd, flags, cmode)) != 0) {
(gdb) 
#12 0xc0213682 in syscall (frame={tf_es = 31, tf_ds = -1078001633, 
      tf_edi = 34680, tf_esi = 95496, tf_ebp = -1077949872, tf_ebx = 357023, 
      tf_edx = 0, tf_ecx = 115299, tf_eax = 5, tf_trapno = 3, tf_err = 2, 
      tf_eip = 1074284471, tf_cs = 23, tf_eflags = 582, tf_esp = -1077949908, 
      tf_ss = 31, tf_vm86_es = 0, tf_vm86_ds = 0, tf_vm86_fs = 0, 
      tf_vm86_gs = 0}) at ../../../../arch/i386/i386/trap.c:782
782             error = (*callp->sy_call)(p, args, rval);