Skip to content

Commit be274f2

Browse files
committed
A streamed ninja runs in its own guarded process group, as the captured one did
stream_exec ran ninja in mcpp's process group and did not register it with the signal guard, so signalling mcpp alone left ninja running (e2e 340, the Linux e2e shard). It now asks the bounded launcher for a group of its own, which the guard kills when mcpp is signalled, as capture_exec's child is.
1 parent 575c13a commit be274f2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎modules/platform/src/process.cppm‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,8 +1201,11 @@ int stream_exec(const std::vector<std::string>& argv,
12011201
if (timed_out) *timed_out = false;
12021202
if (spawn_error) *spawn_error = 0;
12031203
if (argv.empty()) return 127;
1204+
// Its own process group, registered with the signal guard, as
1205+
// capture_exec's child is: a build's ninja must not outlive the mcpp that
1206+
// started it when that mcpp alone is signalled (e2e 340).
12041207
auto r = dispatch_bounded(argv, extraEnv, {}, deadline, /*capture=*/true, {},
1205-
std::chrono::milliseconds{0}, /*ownGroup=*/false, &on_line);
1208+
std::chrono::milliseconds{0}, /*ownGroup=*/true, &on_line);
12061209
if (!r.supported) {
12071210
if (r.spawn_error != 0) {
12081211
if (spawn_error) *spawn_error = r.spawn_error;

0 commit comments

Comments
 (0)