-CURRENT kernel panics when booting with debug.witness_watch tunable set to 0
in loader. It looks like witness_assert function should not do anything in
this case. Attached patch fixes the problem for me.
The panic I am getting looks like that:
panic: Lock (sx) fork list not locked @ ../../kern/kern_fork.c:590.
Debugger("panic")
Stopped at Debugger+0x44: pushl %ebx
db> trace
Debugger(c034ff7b) at Debugger+0x44
panic(c0353360,c0350540,c034da0e,c034da2a,24e) at panic+0x70
witness_assert(c03e3c00,2,c034da2a,24e,0) at witness_assert+0x9f
_sx_sunlock(c03e3c00,c034da2a,24e,c03c7c30,c0b3dad0) at _sx_sunlock+0x8e
fork1(c0426e00,20014,c0426de0) at fork1+0x1c6a
create_init(0,4eec00,4ee000,0,c012f0b2) at create_init+0x18
mi_startup() at mi_startup+0x90
begin() at begin+0x29
db>
The patch:
Index: subr_witness.c
===================================================================
RCS file: /usr/ncvs/src/sys/kern/subr_witness.c,v
retrieving revision 1.77
diff -u -r1.77 subr_witness.c
--- subr_witness.c 2001/06/27 06:27:29 1.77
+++ subr_witness.c 2001/06/28 20:27:57
@@ -1351,6 +1351,9 @@
#ifdef INVARIANT_SUPPORT
struct lock_instance *instance;
+ if (lock->lo_witness == NULL || witness_dead)
+ return;
+
if ((lock->lo_class->lc_flags & LC_SLEEPLOCK) != 0)
instance = find_instance(curproc->p_sleeplocks, lock);
else if ((lock->lo_class->lc_flags & LC_SPINLOCK) != 0)
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message