panic: lockmgr: locking against myself

Matthew Dillon dillon at apollo.backplane.com
Sat Apr 25 18:12:03 PDT 2009


:Fresh build, full hammer setup and triggered by kdesu (KDE wrapper for su 
:command). The panic is 100% reproduceable. Core is uploaded into leaf.
:
:...

    I think I see what's going on here.  It's double-closing the
    tty vnode.  It looks like the case can occur if the process doing
    it is in the background and all other references have gone away.

    Please try this patch and tell me if it solves the problem.

						-Matt

diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index ce27467..d013009 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -147,10 +147,12 @@ retry:
 			vdrop(ttyvp);
 			goto retry;
 		}
+		p->p_session->s_ttyvp = NULL;
 		vclrflags(ttyvp, VCTTYISOPEN);
 		error = VOP_CLOSE(ttyvp, FREAD|FWRITE);
 		vn_unlock(ttyvp);
 		vdrop(ttyvp);
+		vrele(ttyvp);	/* ref from s_ttyvp */
 	} else {
 		error = 0;
 	}





More information about the Bugs mailing list