fix: contain mutation subprocesses - #93
Open
darksectorai wants to merge 3 commits into
Open
Conversation
darksectorai
marked this pull request as ready for review
July 11, 2026 23:28
mcgoughprogress
added a commit
to mcgoughprogress/gomu
that referenced
this pull request
Aug 31, 2026
…inment fix: contain mutation subprocesses (port of sivchari#93)
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.
Summary
Root cause
exec.CommandContextterminated the immediatego testprocess on timeout, but a spawned test binary could remain alive and continue consuming resources. Mutation runs also created one goroutine per mutant, compilation had no timeout, and command output was buffered without a limit.The command runner now places Unix children in a dedicated process group and kills the group on cancellation. The mutation timeout covers both compilation and testing, and cancellation propagates from the Cobra root context through file processing.
Child Go processes receive
GOMEMLIMIT=2GiBby default. SetGOMU_CHILD_GOMEMLIMITto override it.Validation
go test ./...make testmake lintPortability
Unix platforms receive process-group termination. Other platforms retain direct-child termination behavior.