ninja-build/ninja

Signal handling does not work as expected

Open

#1.241 geöffnet am 16. Feb. 2017

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (1.544 Forks)batch import
help wanted

Repository-Metriken

Stars
 (10.194 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 39T 3h) (10 gemergte PRs in 30 T)

Beschreibung

Ninja on POSIX systems currently puts children in their own process group. This policy causes a variety of problems, since ninja doesn't perfectly forward signals to children --- for example, C-z in the terminal sends a SIGTSTP (and then SIGSTOP) to ninja, but since ninja doesn't do anything special for SIGTSTP, the compilation jobs keep running. SIGINT frequently doesn't interrupt compilation jobs either.

In GNU Make, all of these interactions work as you'd expect.

Why do we need to put subprocesses in their own process group? This whole issue disappears if we don't put children in their own process groups, let them inherit the controlling terminal, and allow signal propagation to work normally.

Contributor Guide