Date: Wed, 07 Feb 2001 18:53:41 -0500 From: Jake Burkholder <jburkholder0829@home.com> To: Andrea Campi <andrea@webcom.it> Cc: John Baldwin <jhb@FreeBSD.ORG>, Jim Bloom <bloom@acm.org>, "Crist J. Clark" <cjclark@reflexnet.net>, current@FreeBSD.ORG Subject: Re: Kernel Panic from Yesterday's CVSup Message-ID: <20010207235341.C22E2BAB0@cr66388-a.rchrd1.on.wave.home.com> In-Reply-To: Message from Andrea Campi <andrea@webcom.it> of "Wed, 07 Feb 2001 23:55:01 %2B0100." <20010207235459.B534@webcom.it>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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. > This is why you're getting the panic in exit1(), but I thought I fixed this in intr_machdep.c version 1.47. revision 1.47 date: 2001/01/28 17:20:11; author: jake; state: Exp; lines: +2 -1 Clear intr_nesting_level when an interrupt thread has no more handlers and wants to exit, so it doesn't panic in exit1() which malloc()s with M_WAITOK. Reported by: Bob Bishop <rb@gid.co.uk> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010207235341.C22E2BAB0>