[release/0.25] fix: reset inherited signal dispositions for forked processes on macOS - #245
Merged
David Negstad (danegsta) merged 2 commits intoAug 20, 2026
Conversation
On macOS, processes started by 'dcp fork-process' inherited the Go runtime's signal handler flags (SA_SIGINFO|SA_ONSTACK|SA_RESTART). Other language runtimes do not expect to start with those flags set, and NativeAOT .NET binaries crash with SIGSEGV the first time they take a GC suspension via SIGUSR1. Clearing the dispositions in 'fork-process' before starting the child does not help, because the Go runtime restores its own dispositions in the forked child before it reaches execve. The reset has to happen in the process that calls exec, so 'fork-process' now routes the child through a hidden 'fork-process-exec' command that clears the dispositions and then execs the requested program. Since execve keeps the process ID, the reported PID, session, standard streams, and exit code all stay the same. The reset is a no-op on other platforms, where children are started directly as before. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fcd61592-fa3e-49ab-8efc-d21136bb147d
Routing the child through the exec shim made every start look successful, because the process being started became dcp itself, which always exists and is executable. A program that could not be run was reported as started and its PID was written to stdout, even though the process exited immediately. Commands are given absolute paths, which skip the PATH lookup that used to catch this before the child was started. The shim now reports the outcome of the exec on an inherited descriptor: a successful execve closes it, and a failure sends the errno first. 'fork-process' waits for that before reporting the PID, so a program that cannot be executed is once again a start failure carrying the original reason. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: fcd61592-fa3e-49ab-8efc-d21136bb147d
David Negstad (danegsta)
requested a review
from Karol Zadora-Przylecki (karolz-ms)
August 19, 2026 23:34
Karol Zadora-Przylecki (karolz-ms)
approved these changes
Aug 19, 2026
David Negstad (danegsta)
enabled auto-merge (squash)
August 20, 2026 00:25
David Negstad (danegsta)
merged commit Aug 20, 2026
8efd260
into
release/0.25
12 of 14 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #244 to release/0.25
/cc David Negstad (@danegsta)
Customer Impact
Testing
Risk
Regression?