Fix deadlock occuring when booting vkernel from gdb. One lwp in the vkernel
authorNicolas Thery <nth@dragonflybsd.org>
Sun, 13 Jul 2008 10:28:51 +0000 (10:28 +0000)
committerNicolas Thery <nth@dragonflybsd.org>
Sun, 13 Jul 2008 10:28:51 +0000 (10:28 +0000)
commitfede0c7f749221478cfc6a25ce535f8d733a1e3c
tree19f5a226195373e40932bcd58598ab62e5a6e0d1
parent02325004b43a5e9bfeeb63e0112467148d1e4b95
Fix deadlock occuring when booting vkernel from gdb.  One lwp in the vkernel
sends a signal to another one and is preempted by the signal receiving one in
userexit().  As the vkernel is traced, the vkernel process is stopped and the
receiving lwp stops too.  The emitting lwp then resumes and blocks later on a
condition variable.  The gdb process sleeps on wait(2) which never completes
because the emitting lwp is not stopped.

To prevent this, stop lwps in userexit(), after lwkt_reschedule, if their
owning process is stopped.

Reported-by: Simon Schubert <corecode@fs.ei.tum.de>
sys/platform/pc32/i386/trap.c
sys/platform/vkernel/i386/trap.c