fix(fspy): bundle osh with the RunProcess getpgid ESRCH fix - #703
Open
lifeiscontent wants to merge 1 commit into
Open
fix(fspy): bundle osh with the RunProcess getpgid ESRCH fix#703lifeiscontent wants to merge 1 commit into
lifeiscontent wants to merge 1 commit into
Conversation
Stock oils 0.37.0 calls getpgid(child) after fork even with job control disabled, and on macOS getpgid of an already-exited child fails with ESRCH, so a fast external command intermittently killed the substituted shell with "oils I/O error (main): No such process" and exit 2 — a few percent of runs under CPU contention. Bundle a build of 0.37.0 plus the upstream fix (oils-for-unix/oils#2689, gate the getpgid on job control being enabled) until an oils release carries it. crates/fspy/tests/oils_esrch.rs pins the fix: it fails against a stock binary and passes against the patched one. Fixes voidzero-dev#702.
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
注册 for free
to join this conversation on GitHub.
Already have an account?
登录 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.
Motivation
Fixes #702.
Cached tasks on macOS run under the bundled osh (fspy substitutes it for
/bin/sh, which as a platform binary can't loadDYLD_INSERT_LIBRARIES). Stock oils 0.37.0 resolves the child's pgid withgetpgid()right after fork, before waiting on it — and on macOSgetpgid()of an already-exited child fails with ESRCH. The shell dies withoils I/O error (main): No such process, exit 2, empty stdout. Under CPU contention (parallel test runs) a few percent of spawns die this way.Upstream fix: oils-for-unix/oils#2689 — the pgid feeds
MaybeGiveTerminal(), which already no-ops when job control is disabled, so the `getpgid()) is gated on job control being enabled and batch shells never pay the race.Changes
crates/fspy/build.rsdownloads a 0.37.0 + patch build from https://github.com/lifeiscontent/oils-for-unix-build/releases/tag/oils-for-unix-0.37.0-fspy.1 (built by that repo's release workflow from the stock tarball pluspatches/0001-run-process-esrch.patch, with build provenance attestations) until an upstream oils release carries the fix. If voidzero wants the binary under its own hosting, rebuilding from that repo's workflow and swapping the two URLs and hashes is the whole change.crates/fspy/tests/oils_esrch.rsruns 200 tracked shells through fast external commands under contention; it fails against the stock binary and passes against the patched one.