From 8cad221b598a9d5621d5d37b2a97ecd0ba47c61c Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Fri, 23 Jan 2015 02:22:18 +0100 Subject: [PATCH gnumach] kern: fix the scheduler id:87tx46m4ls.fsf@schwinge.name As a normal user: $ rpctrace -o /tmp/expect.$$.rpctrace -s 99999 /usr/bin/expect panic: thread_invoke: thread e19dc7e8 has unexpected state 14 Debugger invoked: panic [...] 0x14 is TH_RUN|TH_HALTED. TH_RUN means a thread is running or on a run queue, TH_HALTED means a thread is halted at a clean point. That does sound reasonable. * kern/sched_prim.c (thread_invoke): Handle TH_RUN|TH_HALTED. (thread_dispatch): Likewise. --- kern/sched_prim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kern/sched_prim.c b/kern/sched_prim.c index 376217a..023bffb 100644 --- a/kern/sched_prim.c +++ b/kern/sched_prim.c @@ -667,6 +667,7 @@ boolean_t thread_invoke( switch (old_thread->state) { case TH_RUN | TH_SUSP: case TH_RUN | TH_SUSP | TH_HALTED: + case TH_RUN | TH_HALTED: case TH_RUN | TH_WAIT | TH_SUSP: /* * Suspend the thread @@ -924,6 +925,7 @@ void thread_dispatch( switch (thread->state &~ TH_SWAP_STATE) { case TH_RUN | TH_SUSP: case TH_RUN | TH_SUSP | TH_HALTED: + case TH_RUN | TH_HALTED: case TH_RUN | TH_WAIT | TH_SUSP: /* * Suspend the thread -- 2.1.4