Repository navigation
mutate: each test process in a cgroup of its own when the run was delegated one - #48
Merged
Merged
Conversation
…egated one On 2026-10-22 a mutate run took a 30 GiB workstation until it hung: thousands of importer-4.test processes of 20-50 MiB each, a binary that started itself each time it started. The /proc watch measures one process tree, and each process left the tree when its parent died, so the tree never held much. Run in a cgroup systemd delegated it (systemd-run --user --scope -p Delegate=yes), mutate moves its own processes to a child and starts each test process in a child of its own (clone3 into the cgroup): memory.max at its share, no swap, pids.max 1024, a fork refused there stops the group, and what is left when the test ends is killed and the cgroup removed - which also ends the wait on a pipe a grandchild held open. Anywhere else it measures /proc as before, and the run says which it does. The cgroup code runs in a test that re-runs itself in a delegated scope, a process whose coverage a mutate run does not see; its functions carry mutate-lane markers naming that test, and planted mutants of each were refused by it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
On 2026-10-22 a
task mutaterun hung a 30 GiB workstation: the kernel killed thousands ofimporter-4.testprocesses of 20-50 MiB each. One binary was starting itself every time it started. The /proc watch measures one process tree, and each process left the tree when its parent died, so the tree never held much.systemd-run --user --scope -p Delegate=yes), mutate moves its own processes to a child cgroup. It then starts each test process in a cgroup of its own, using clone3 into the cgroup:memory.maxat the test's share, and no swap.pids.max1024; once a fork is refused there, the whole group is stopped.TestATestProcessIsHeldByItsCgroupre-runs itself in a delegated scope. In that scope it covers memory, a fork bomb, a leftover child and cleanup, and it skips when there is no user manager. A mutate run does not see coverage from that process, so the cgroup functions carrymutate-lanemarkers naming the test. I planted mutants in each of them by hand, and the test refused every one.Checked:
task test,task lint, andgo run ./cmd/mutate -max 200in a delegated scope (28 refused, 0 survived).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.