From owner-freebsd-current Thu Jun 28 14: 8:21 2001 Delivered-To: freebsd-current@freebsd.org Received: from h132-197-97-45.gte.com (h132-197-97-45.gte.com [132.197.97.45]) by hub.freebsd.org (Postfix) with ESMTP id B708737B40A; Thu, 28 Jun 2001 14:08:17 -0700 (PDT) (envelope-from ak03@gte.com) Received: (from ak03@localhost) by h132-197-97-45.gte.com (8.11.4/8.11.4) id f5SL8Gi00739; Thu, 28 Jun 2001 17:08:16 -0400 (EDT) (envelope-from ak03) Date: Thu, 28 Jun 2001 17:08:16 -0400 From: "Alexander N. Kabaev" To: freebsd-current@FreeBSD.org Cc: jhb@FreeBSD.org Subject: Kernel panics with debug.witness_watch=0 Message-ID: <20010628170816.A717@kanpc.gte.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.19i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG -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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message