Subject: panic: lockmgr: no context
To: None <current-users@netbsd.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: current-users
Date: 08/07/1999 22:11:49
A few weeks ago I complained about locked vnodes, but I also had
corrupt amap panics at the time, so the situation was never clear
cut. All the amap/uvm etc problems seem to fixed - thanks! Now I
had a current of yesterday/i386 machine freeze with several processes
in state vnlock. This particular case happened during the mtree at
the beginning of a make build. Another favorite is during a
sh MAKEDEV when making an install disk. These vnlocks seem to be
linked to the fact that I have a modem on /dev/tty01, with

tty01   "/usr/libexec/getty std.38400"  unknown on secure local

running. If I power cycle the (external) modem, or simply plug/unplug
the serial cable, the machine "unfreezes". I think this may be
similar to Bjoern Labitzke's posting of 4 Aug 1999 "Machine solidly
stuck..." running vgetty. I think first someone has to phone the
modem not using a modem, and then I have to sh MAKEDEV or something
for the computer to freeze.

This time I switched to ddb, and call printlockedvnodes() just said 0x2.
Calling cpu_reboot(0x100) resulted in:

panic: lockmgr: no context
#0  0xf024411e in in6mask128 ()
(gdb) bt
#0  0xf024411e in in6mask128 ()
#1  0x2037000 in ?? ()
#2  0xf01ebd17 in cpu_reboot (howto=260, bootstr=0x0)
    at ../../../../arch/i386/i386/machdep.c:1212
#3  0xf015a6f9 in panic () at ../../../../kern/subr_prf.c:217
#4  0xf014ea88 in lockmgr (lkp=0xf05dba14, flags=65537, interlkp=0xf02b3460)
    at ../../../../kern/kern_lock.c:316
#5  0xf01713b5 in vfs_busy (mp=0xf05dba00, flags=16, interlkp=0xf02b3460)
    at ../../../../kern/vfs_subr.c:232
#6  0xf017296d in printlockedvnodes () at ../../../../kern/vfs_subr.c:1499

which doesn't seem to tell much - no lookup in sight..

(gdb) print {struct lock}0xf05dba14
$5 = {lk_interlock = {lock_data = 0}, lk_flags = 0, lk_sharecount = 0, 
  lk_exclusivecount = 0, lk_recurselevel = 0, lk_waitcount = 0, 
  lk_wmesg = 0xf0247fc2 "vfslock", lk_un = {lk_un_sleep = {
      lk_sleep_lockholder = -1, lk_sleep_prio = 20, lk_sleep_timo = 0}, 
    lk_un_spin = {lk_spin_cpu = 4294967295}}}
(gdb) print {struct mount}0xf05dba00
$9 = {mnt_list = {cqe_next = 0xf05db200, cqe_prev = 0xf02725d4}, 
  mnt_op = 0xf02758c0, mnt_vnodecovered = 0x0, mnt_vnodelist = {
    lh_first = 0xf7f339d8}, mnt_lock = {lk_interlock = {lock_data = 0}, 
    lk_flags = 0, lk_sharecount = 0, lk_exclusivecount = 0, 
    lk_recurselevel = 0, lk_waitcount = 0, lk_wmesg = 0xf0247fc2 "vfslock", 
    lk_un = {lk_un_sleep = {lk_sleep_lockholder = -1, lk_sleep_prio = 20, 
        lk_sleep_timo = 0}, lk_un_spin = {lk_spin_cpu = 4294967295}}}, 
  mnt_flag = 20480, mnt_maxsymlinklen = 60, mnt_stat = {f_type = 0, 
    f_flags = 20480, f_bsize = 1024, f_iosize = 8192, f_blocks = 135807, 
    f_bfree = 60518, f_bavail = 53727, f_files = 34558, f_ffree = 33393, 
    f_fsid = {val = {1024, 1931}}, f_owner = 0, f_spare = {0, 0, 0, 0}, 
    f_fstypename = "ffs", '\000' <repeats 12 times>, 
    f_mntonname = "/", '\000' <repeats 88 times>, 
    f_mntfromname = "/dev/sd0a", '\000' <repeats 80 times>}, 
  mnt_data = 0xf05db800, mnt_wcnt = 0}

and sure enough, /dev/sd0a is my root partition, so / got locked.
How can I delve into this further (eg. to make it worth a PR)?

Cheers,

Patrick