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: Matthias Scheler <tron@zhadum.org.uk>
List: netbsd-bugs
Date: 07/22/2007 12:40:07
The following reply was made to PR kern/36669; it has been noted by GNATS.

From: Matthias Scheler <tron@zhadum.org.uk>
To: Antti Kantee <pooka@cs.hut.fi>
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 12:48:36 +0100

 On Sun, Jul 22, 2007 at 02:42:45PM +0300, Antti Kantee wrote:
 > Are you sure you didn't misapply the patch?
 
 That is in deed the problem. There is a "procfs_vnops.c.rej" in my
 "src/sys/misc/procfs":
 
 ***************
 *** 1543,1553 ****
   			}
   			bp = path + MAXPATHLEN;
   			*--bp = '\0';
 - 			vp = curproc->p_cwdi->cwdi_rdir;	/* XXXSMP */
 - 			if (vp == NULL)
 - 				vp = rootvnode;
 - 			error = getcwd_common(vxp, vp, &bp, path,
 - 			    MAXPATHLEN / 2, 0, curlwp);
   			FILE_UNUSE(fp, curlwp);
   			if (error)
   				break;
 --- 1555,1574 ----
   			}
   			bp = path + MAXPATHLEN;
   			*--bp = '\0';
 + 
 + 			/*
 + 			 * 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);
 + 			}
   			FILE_UNUSE(fp, curlwp);
   			if (error)
   				break;
 
 > I forgot to mention it was against -current, not netbsd-4.
 
 Can you create a patch against "netbsd-4", please? This machine is my
 server which quite a few threaded daemons that wouldn't work with
 a current kernel on top of 4.0_BETA2 userland.
 
 	Kind regards
 
 -- 
 Matthias Scheler                                  http://zhadum.org.uk/