From owner-freebsd-current Wed Feb 7 15: 1:40 2001 Delivered-To: freebsd-current@freebsd.org Received: from webcom.it (unknown [212.239.10.243]) by hub.freebsd.org (Postfix) with SMTP id 4AD9B37B6C3 for ; Wed, 7 Feb 2001 15:01:19 -0800 (PST) Received: (qmail 3018 invoked by uid 1000); 7 Feb 2001 22:55:02 -0000 Date: Wed, 7 Feb 2001 23:55:01 +0100 From: Andrea Campi To: John Baldwin Cc: Jim Bloom , "Crist J. Clark" , current@FreeBSD.org Subject: Re: Kernel Panic from Yesterday's CVSup Message-ID: <20010207235459.B534@webcom.it> References: <20010207124609.A594@webcom.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jhb@FreeBSD.org on Wed, Feb 07, 2001 at 02:20:43PM -0800 X-Echelon: BND CIA NSA Mossad KGB MI6 IRA detonator nuclear assault strike Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Feb 07, 2001 at 02:20:43PM -0800, John Baldwin wrote: > > On 07-Feb-01 Andrea Campi wrote: > > Running a kernel I got with this: > > > >> > >> cvs co -D"2001-01-30" src/sys > >> > > > > /ithread.c/1.10/Mon Dec 4 21:15:14 2000//D2001.01.29.23.00.00 > > > > I get: > > > > panic: malloc(M_WAITOK) in interrupt context > > Debugger("panic") > > Stopped at Debugger+0x45: pushl %ebx > > db> trace > > Debugger(c02119a3) at Debugger+0x45 > > panic(....) > > malloc(48,c0238100,0,c65feb80,0) at malloc+0x2a > > exit1(c65feb80,0,0,c6623f78,c01fc852) at exit1+0x1b1 > > kthread_suspend(0,c0279a40,0,c022d1ec,a2) at kthread_suspend > > ithd_loop(0,c6623fa8) at ithd_loop+0x56 > > fork_exit(c01fc7fc,0,c6623fa8) at fork_exit+0x8 > > fork_trampoline() at fork_trampoline+0x8 > > db> witness_list > > "Giant" (0xc0279a40) locked at ../../i386/isa/ithread.c:162 > > Erm, ithd_loop() doesn't call kthread_suspend(). *sigh*. Something > else is rather messed up here I'm afraid. So I thought... also, kthread_suspend() doesn't call exit1(), does it? No matter what, ithd_loop() calls kthread_exit() which calls exit1() which happily MALLOC's with M_WAITOK... Something is messed up, indeed, but it seems to be a case of WISIWYG instead of what I mean... ;-) Also, I think this issue has been there longer but it might have been masked by me not having INVARIANTS defined at times (am I correct to read the code as not panicing #ifndef INVARIANTS?). So I am going back before this revision: revision 1.78 date: 2001/01/21 19:25:07; author: jake; state: Exp; lines: +3 -2 Make intr_nesting_level per-process, rather than per-cpu. Setup interrupt threads to run with it always >= 1, so that malloc can detect M_WAITOK from "interrupt" context. This is also necessary in order to context switch from sched_ithd() directly. Re: the strace db trace above, is it possible that it might be because I have: CFLAGS ?= -O -pipe -mcpu=i686 -march=i686 COPTFLAGS ?= -O -pipe -mcpu=i686 -march=i686 in make.conf? I put these after somebody mentioned using it here... Bye, Andrea -- Weird enough for government work. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message