Repository navigation
fix(executor): dispatch gates & spawn/fd faces — deep-audit lane F5 (Refs #2692 #2689 #2694 #2698 #2718 #2690 #2691 #2722) - #2767
Merged
Conversation
Eight mechanism-level fixes, each cited against GNU bash 5.3 C source and probe-verified byte-for-byte against the 5.3.20 binary (script-file differentials). Regression pins per issue under tests/. rubash#2692 (A2-07, HIGH): state-mutating builtins executed despite failed redirections. GNU runs do_redirections (RX_UNDOABLE) before the builtin body (execute_cmd.c:5606-5614) and converts EX_REDIRFAIL to a shell exit for posix special builtins (execute_cmd.c:4865-4875). The dispatch funnel now pregates every in-process builtin dispatch with the ordered open walk. The pregate undoes its probe file creations on success (pregate_redirect_open_check) so the dispatch's own application observes pristine state — a probe-created file made `set -C > fresh.txt` refuse itself (rubash#1020 pin). rubash#2689 (A2-02): `command <external>` in a pipeline stage dropped the stage's redirections — the spawn plans stdio from the stage clone's fd table, where the stripped entries were never bound. execute_builtin_pipeline_stage now binds the element's output redirects into the clone (open_compound_output_redirects, list order) and claims the pipeline_stage_fds_pre_wired latch — the function stage's composition. rubash#2694 (A2-09): pipeline stages leaked the process umask back to the parent. execute_pipeline_stage now brackets the stage with the same process-umask snapshot/restore the comsub and ( ) fork boundaries carry. rubash#2698 (A2-16): a killed job was listed again after its death notice printed. format_signal_notices now reports which pids' notices actually printed; both print sites mark exactly those jobs notified, and the boundary report runs cleanup_dead_jobs — notify_and_cleanup (jobs.c) retires as it notifies, so `wait %1` after a boundary notice is "no such job" (127) while `wait <pid>` keeps its status (bgpids parity). rubash#2718 (B2-F06): null (redirect-only) commands expanded redirect words before binding permanent assignments — GNU binds during expand_words, do_redirections runs after (execute_cmd.c:4626-4635, :4268-4286). The reject gate moved behind the bind on both null-command paths. rubash#2690 (A2-03): `exec >/dev/stdout` bound a dup instead of reopening. An fd-alias PATH spelling is an open (redir.c:725), not a dup; the exec redirects-only walk now diverts non-dup-spelling dev-stdio targets to a real open_write (noclobber-gated, redir.c:676). rubash#2691 (A2-04): `>&/dev/fd/N`, `>&/dev/stderr` failed ENOENT — the output-target opener's ladder had no arm for pipe/stdio/coproc write endpoints. It now maps every FdWriteEndpoint to its walk-level OutputTarget twin (r_err_and_out open semantics, redir.c:832-838). rubash#2722 (B3-F05): $BASH_SUBSHELL over-counted for a ( ) pipeline stage (the stage clone pays the element level, the node bumped again). execute_compound_pipeline_stage absorbs the paid level for a paren element — the pipeline twin of the background path's paren absorb (execute_cmd.c:2620, :1588) — BASHPID fabrication (pid + depth - origin) stays distinct in the same shapes. Tests: 8 new stems, 39 pins, all green under scrubbed_cargo; neighboring redirect/jobs/pipeline/stage stems adjudicated (the two issue_1967 net-connection pins fail identically on pristine master in this environment — pre-existing, not this lane). UNVERIFIED-BY-CAPTAIN. Refs #2692 #2689 #2694 #2698 #2718 #2690 #2691 #2722
This was referenced Nov 3, 2026
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.
Deep-audit fix lane F5 — executor dispatch gates and spawn/fd faces. Eight mechanism-level fixes, each cited against GNU bash 5.3 C source and probe-verified byte-for-byte against the 5.3.20 binary (script-file differentials, stdout through a pipe). UNVERIFIED-BY-CAPTAIN.
( )is a pipeline stage (stage bump + paren bump) #2722 (B3-F05): a paren pipeline stage absorbs the element level the stage clone already paid (pipeline twin of the background paren absorb); BASH_SUBSHELL and BASHPID invariants pinned in the same shapes.Verification: 8 new regression stems, 39 pins, all green via scrubbed_cargo with per-stem counts in the lane report. Neighboring stems adjudicated: 13 of 14 green; the issue1025 stem's two net-connection pins fail identically on pristine master in this environment (pre-existing). One regression introduced by the first pregate cut (issue1020 noclobber self-refusal) was found by neighbor adjudication and fixed in this same branch.
Known remaining delta (pre-existing, outside this lane's findings): boundary death notices are stamped with the just-finished command's line instead of the upcoming command's line (pid and stamp normalized out of the #2698 pins).
Refs #2692
Refs #2689
Refs #2694
Refs #2698
Refs #2718
Refs #2690
Refs #2691
Refs #2722