ninja-build/ninja

Signal handling does not work as expected

开放

#1,241 创建于 2017年2月16日

 (2 条评论) (0 个反应) (0 位负责人)C++ (1,544 个派生)batch import
help wanted

仓库指标

星标
 (10,194 个星标)
PR 合并指标
 (平均合并 39天 3小时) (30 天内合并 10 个 PR)

描述

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.

贡献者指南