Kernel Panic III: Fatal trap 12: page fault while in kernel mode

Matthew Dillon dillon at apollo.backplane.com
Sun Jul 4 21:00:22 PDT 2004


:I'm back, after disabling softupdates as Matt suggested, I have had another
:kernel panic although this one appears to be a different one than the last.
:
:This one occured while doing a make install in /usr/ports via a remote
:ssh session.
:
:Simple backtrace:
:http://drevil.warpcore.org/crash3_bt.log.gz
:
:Full backtrace:
:http://drevil.warpcore.org/crash3_bt_full.log.gz
:
:Thanks.

    I'd like you to try the below patch.  The 0xdeadc0de VM fault value is 
    a big hint, it seems to indicate that the vnode is being recycled while
    or soon after it has been added to the mount queue and I found a 
    possible race.

    There's only about a 30% chance that this is the bug, so I am crossing
    my fingers.  I would really like to try to find and fix this bug before
    the release.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

Index: kern/vfs_subr.c
===================================================================
RCS file: /cvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.34
diff -u -r1.34 vfs_subr.c
--- kern/vfs_subr.c	4 Jul 2004 05:16:30 -0000	1.34
+++ kern/vfs_subr.c	5 Jul 2004 03:29:55 -0000
@@ -636,7 +636,7 @@
 	lwkt_tokref ilock;
 	lwkt_tokref vlock;
 
-	s = splbio();
+	s = splbio();	/* YYY remove me */
 
 	/*
 	 * Try to reuse vnodes if we hit the max.  This situation only
@@ -803,11 +803,16 @@
 	vp->v_type = VNON;
 	vp->v_tag = tag;
 	vp->v_op = vops;
-	insmntque(vp, mp);
 	*vpp = vp;
 	vp->v_usecount = 1;
-	vp->v_data = 0;
+	vp->v_data = NULL;
 	splx(s);
+
+	/*
+	 * Placing the vnode on the mount point's queue makes it visible.
+	 * We had better already have a ref on it.
+	 */
+	insmntque(vp, mp);
 
 	vfs_object_create(vp, td);
 	return (0);





More information about the Bugs mailing list