Subject: Re: kern/36669: NetBSD 4.0_BETA2 crashes with "panic: lockmgr: locking against myself"
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Antti Kantee <pooka@cs.hut.fi>
List: netbsd-bugs
Date: 07/22/2007 11:45:02
The following reply was made to PR kern/36669; it has been noted by GNATS.

From: Antti Kantee <pooka@cs.hut.fi>
To: Matthias Scheler <tron@zhadum.org.uk>
Cc: gnats-bugs@NetBSD.org
Subject: Re: kern/36669: NetBSD 4.0_BETA2 crashes with "panic: lockmgr: locking against myself"
Date: Sun, 22 Jul 2007 14:42:45 +0300

 On Sun Jul 22 2007 at 12:31:20 +0100, Matthias Scheler wrote:
 > > > #16 0xc022511d in procfs_readlink (v=0xd419eabc)
 > > >     at /usr/src/sys/miscfs/procfs/procfs_vnops.c:1469
 > > 
 > > print *vxp
 > 
 > (gdb) print *vxp
 > $2 = {v_uobj = {vmobjlock = {lock_data = 0}, pgops = 0xc051a58c, memq = {
 >       tqh_first = 0x0, tqh_last = 0xcd9331a0}, uo_npages = 0, uo_refs = 3}, 
 >   v_size = 0, v_flag = 0, v_numoutput = 0, v_writecount = 0, v_holdcnt = 0, 
 >   v_mount = 0xc273b000, v_op = 0xc28f9e00, v_freelist = {tqe_next = 0x0, 
 >     tqe_prev = 0x0}, v_mntvnodes = {tqe_next = 0xcd9330ec, 
 >     tqe_prev = 0xcd933284}, v_cleanblkhd = {lh_first = 0x0}, v_dirtyblkhd = {
 >     lh_first = 0x0}, v_synclist_slot = 0, v_synclist = {tqe_next = 0x0, 
 >     tqe_prev = 0x0}, v_dnclist = {lh_first = 0x0}, v_nclist = {
 >     lh_first = 0x0}, v_un = {vu_mountedhere = 0x0, vu_socket = 0x0, 
 >     vu_specinfo = 0x0, vu_fifoinfo = 0x0, vu_ractx = 0x0}, v_lease = 0x0, 
 >   v_type = VDIR, v_tag = VT_PROCFS, v_lock = {lk_interlock = {lock_data = 0}, 
 >     lk_flags = 1024, lk_sharecount = 0, lk_exclusivecount = 1, 
 >     lk_recurselevel = 0, lk_waitcount = 0, lk_wmesg = 0xc04ca8d4 "vnlock", 
 >     lk_un = {lk_un_sleep = {lk_sleep_lockholder = 294, lk_sleep_locklwp = 1, 
 >         lk_sleep_prio = 20, lk_sleep_timo = 0, lk_newlock = 0x0}, 
 >       lk_un_spin = {lk_spin_cpu = 294}}}, v_vnlock = 0xcd93320c, 
 >   v_data = 0xc2ebcf40, v_klist = {slh_first = 0x0}}
 
 Are you sure you didn't misapply the patch?  I forgot to mention it was
 against -current, not netbsd-4.
 
 If vxp->v_tag is VT_PROCFS, getcwd_common() is not called:
 
                         /* 
                          * XXX: kludge to avoid locking against ourselves
                          * in getcwd()
                          */
                         if (vxp->v_tag == VT_PROCFS) {
                                 *--bp = '/';
                         } else {
                                 vp = curproc->p_cwdi->cwdi_rdir; /* XXXSMP */
                                 if (vp == NULL)
                                         vp = rootvnode;
                                 error = getcwd_common(vxp, vp, &bp, path,
                                     MAXPATHLEN / 2, 0, curlwp);
                         }
 
 -- 
 Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
 http://www.iki.fi/pooka/                          http://www.NetBSD.org/
     "la qualité la plus indispensable du cuisinier est l'exactitude"