From owner-freebsd-current@FreeBSD.ORG Thu Sep 18 12:57:31 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8605816A4B3 for ; Thu, 18 Sep 2003 12:57:31 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC15F43FFB for ; Thu, 18 Sep 2003 12:57:30 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc11) with ESMTP id <2003091819573001300kv1r6e>; Thu, 18 Sep 2003 19:57:30 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA13846; Thu, 18 Sep 2003 12:57:29 -0700 (PDT) Date: Thu, 18 Sep 2003 12:57:27 -0700 (PDT) From: Julian Elischer To: David Wolfskill In-Reply-To: <200309181853.h8IIr4qZ018877@bunrab.catwhisker.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org Subject: Re: panic: mi_switch: kse state? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2003 19:57:31 -0000 On Thu, 18 Sep 2003, David Wolfskill wrote: > This is on my (SMP) "build" machine; sources updated between 0347 - 0355 > hrs. US/Pacific (7 hrs. W of GMT). > > I had done the usual buildworld, kernel, installworld, mergemaster, > rebooted, ran "healthd -d" for a little while (enough to see some > plausible variation), then entered > > sudo boot0cfg -s 1 ad0 && sudo halt -p || sudo reboot > > and got this (cut/pasted from serial console, which is the only access > I have to the box when it's running -CURRENT, since the NIC (RealTek > 8129) doesn't seem to work any more with the rl driver (per message > from 3 or 4 days ago): > > aWaiting (max 60 seconds) for system process `buftdaemon' to stop...a0: spurious interrupt - status=0x50 error=0x00 > panic: mi_switch: kse state? > cpuid = 1; lapic.id = 01000000 > Debugger("panic") > Stopped at Debugger+0x55: xchgl %ebx,in_Debugger.0 > db> tr > Debugger(c03a88d0,1000000,c03a9d2d,d7112a40,100) at Debugger+0x55 > panic(c03a9d2d,1,c03a9d09,247,0) at panic+0x15f > sched_switchout(c1507850,9,c03a90f4,1d0,8a26d20d) at sched_switchout+0x4d > mi_switch(c1507850,2,c03a7ce3,244,0) at mi_switch+0x218 > _mtx_lock_sleep(c040e7a0,0,c03be2e9,d3,0) at _mtx_lock_sleep+0x266 > _mtx_lock_flags(c040e7a0,0,c03be2e9,d3,0) at _mtx_lock_flags+0x98 > vm_fault(c040a1c0,0,2,8,c1507850) at vm_fault+0x5a > trap_pfault(d7112ca4,0,c7,c040e760,c7) at trap_pfault+0xe9 > trap(ffc00018,c1500010,c1500010,81918a90,c1506b58) at trap+0x31d > calltrap() at calltrap+0x5 > --- trap 0xc, eip = 0xd7112d0f, esp = 0xd7112ce4, ebp = 0x8 --- > _end() at 0xd7112d0f > db> show pcpu 0 > cpuid = 0 > curthread = 0xc1507be0: pid 14 "swi8: tty:sio clock" the current thread (the swi 8 thread) is running, but the associated KSE is not in the state that a KSE should be in for normal running.. do you have a coredump? it would be good to find what the value actually is... what we need is currthread->td_kse->ke_state.. or in this case ((struct thread *)0xc1507850)->td_kse->ke_state x/iiiiiiiiiiiiiiiiiiiiiiiii sched_switchout would show how to find this... (by hand decompiling to match teh following C code..) void sched_switchout(struct thread *td) { struct kse *ke; struct proc *p; ke = td->td_kse; p = td->td_proc; mtx_assert(&sched_lock, MA_OWNED); KASSERT((ke->ke_state == KES_THREAD), ("mi_switch: kse state?")); i.e you should be able to calculate the value for ke and thus for ke_state.