Repository navigation
fix(shell): Windows commands run in a Job Object that bounds and terminates their process tree - #425
Merged
Merged
Conversation
…inates their process tree A diagnostic git shim whose last line was exec git "$@" re-executed itself through PATH forever; Cygwin exec leaves orphans, so taskkill /T could not reach the chain and the parent bash waited for pipe EOF for 90 minutes. Every external command now gets a Job Object with an active-process limit (no kill-on-close, daemons still survive a normal exit); cancel and stop call TerminateJobObject first and fall back to taskkill /T. Regression tests: self-recursive PATH shim is bounded, cancel and Stop kill orphaned descendants, a deliberate daemon survives a normal exit, job helper unit tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Keeps the shell directory at its recorded file count. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…chain, killByPID waits for exit The first versions of T1, T2 and T4 passed or failed for test-design reasons (sleeper redirected away from the pipe, shim without shebang, marker rewritten by MSYS path conversion). The sleeper now holds the output pipe so Run blocks until cancel and TerminateJobObject is what ends the chain. No production change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n guard) noctx forbids exec.Command and TestNoUnhardenedProcessSpawns forbids exec.CommandContext: platform.Command satisfies both and keeps the console window hidden. Co-Authored-By: Claude Sonnet 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.
Windows: every command runs in a Job Object (#151)
The hang (a self-recursive PATH shim whose
exec git "$@"resolved to itself) left orphan chains thattaskkill /Tcannot reach: the parentbashwaited for pipe EOF for 90 minutes.shexec.SetMaxProcessesPerCommand), no KILL_ON_JOB_CLOSE (a deliberate daemon survives a normal exit),TerminateJobObjecton cancel and Stop withtaskkill /Tas the fallback.shexecjob tests. The first versions of T1/T2/T4 were wrong as tests (no shebang, output redirected away from the pipe, path-converted marker), not as code; the fix and the test fixes are in the three commits.Full fork CI run 43747015956 on
8193129ccis green (22 jobs).🤖 Generated with Claude Code