Re: panic: mi_switch: kse state?

From: Julian Elischer <julian_at_elischer.org>
Date: Thu, 18 Sep 2003 12:57:27 -0700 (PDT)
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.
Received on Thu Sep 18 2003 - 10:57:31 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:22 UTC