kernel - Fix panic during coredump
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Jul 2015 07:37:32 +0000 (00:37 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Jul 2015 07:37:32 +0000 (00:37 -0700)
commitf5b92db707a8f80d80fd78012a3fcdda94a8dd8a
tree6a0f3546cdaef09540b9a60182850f28e2eb6256
parentf9fe4c29da01a5fe838dbeb622c453040e99f33a
kernel - Fix panic during coredump

* multi-threaded coredumps were not stopping all other threads before
  attempting to scan the vm_map, resulting in numerous possible panics.

* Add a new process state, SCORE, indicating that a core dump is in progress
  and adjust proc_stop() and friends as well as any code which tests the
  SSTOP state.  SCORE overrides SSTOP.

* The coredump code actively waits for all running threads to stop before
  proceeding.

* Prevent a deadlock between a SIGKILL and core dump in progress by
  temporarily counting the master exit thread as a stopped thread (which
  allows the coredump to proceed and finish).

Reported-by: marino
sys/kern/kern_checkpoint.c
sys/kern/kern_exit.c
sys/kern/kern_sig.c
sys/kern/kern_synch.c
sys/kern/sys_process.c
sys/platform/pc64/x86_64/trap.c
sys/platform/vkernel64/x86_64/trap.c
sys/sys/proc.h
sys/vfs/procfs/procfs_ctl.c
sys/vm/vm_pageout.c