From 8fa0b8051dbe2f4e4a00c162913886a34bf78bfa Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 14 Apr 2018 12:03:34 +0200 Subject: job-control: mitigate process-kill race children_kill_cb() is racey. One obvious problem is that process_close_handles() is *queued* by on_process_exit(), so when children_kill_cb() is invoked, the dead process might still be in the `loop->children` list. If the OS already reclaimed the dead PID, Nvim may try to SIGKILL it. Avoid that by checking `proc->status`. Vim doesn't have this problem because it doesn't attempt to kill processes that ignored SIGTERM after a timeout. closes #8269 --- runtime/doc/eval.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 20f0eb303b..fffdcef8d9 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5033,10 +5033,9 @@ jobstart({cmd}[, {opts}]) *jobstart()* width : (pty only) Width of the terminal screen height : (pty only) Height of the terminal screen TERM : (pty only) $TERM environment variable - detach : (non-pty only) Detach the job process from the - nvim process. The process will not get killed - when nvim exits. If the process dies before - nvim exits, "on_exit" will still be invoked. + detach : (non-pty only) Detach the job process: it will + not be killed when Nvim exits. If the process + exits before Nvim, "on_exit" will be invoked. {opts} is passed as |self| dictionary to the callback; the caller may set other keys to pass application-specific data. -- cgit