Repository navigation
fix(executor): model a pipeline member's spawn failure as a dead child (Refs #3091) - #3720
Merged
Merged
Conversation
…d (Refs #3091) GNU forks every pipeline element (execute_cmd.c:2620): when the child's execve fails it reports shell_execve's classified verdict on its own fd 2 (EACCES -> 126 "Permission denied", ENOENT -> 127 "No such file or directory", execute_cmd.c:6126-6159) and exits — wait_for (jobs.c:3064) records that status into PIPESTATUS while the rest of the pipeline runs to completion. Rubash's spawners returned Err on Command::spawn failure, aborting the whole pipeline: PIPESTATUS came out empty and the member was named by file_name() which dropped the as-typed "./" (findcmd.c:385-387 keeps the attempted pathname for slash-bearing words, the resolved pathname for PATH-found ones). Convert every member spawn to a sparse Vec<Option<Child>>: a failed spawn becomes a pseudo-member whose classified diagnostic is routed through the member's resolved fd-2 plan (piped, null, inherited, direct, ordered-walk files) and whose status occupies its exact PIPESTATUS slot. Downstream members get an EOF stdin, dev-fd operand records are disarmed, and job-control waits receive projected index-aligned subsets. Covered paths: the concurrent all-external spawners (both cfgs), the shell-writer/producer-consumer route, the external-prefix streaming tail, the streaming sandwich, and the sequential stage loop (pipeline_stages.rs), where a dead member also flags pipeline_stage_spawn_dead so the producer-SIGPIPE verdict applies GNU's race outcome — an in-process builtin's write beats the dead child's exit, an external/function/compound producer's does not (WSL GNU 5.3.20 probe: `echo hi | ./pnoexec` -> `0 126`, `cat f | ./pnoexec` -> `141 126`, `fn(){cat;} | ./pnoexec` -> `0 141 126`). Pin tests/issue3091_pipeline_spawn_failure_status.rs: 8/8 green on WSL; probe matrix (first/middle/last member, ENOENT/EACCES, 2>f, 2>/dev/null, 2>&1, |&, 2>&-, >f 2>&1, fn sandwich, redirect-ordering) byte-identical to /usr/local/bin/bash; adjacent pins 1580/1363/1571/ 1552/1540/0074-1383/1545/1807/1835/1462 all green. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Nov 15, 2026
Merged
caomengxuan666
added a commit
that referenced
this pull request
Nov 18, 2026
The stale-hash pipeline-member mechanism (wrong ENOENT name, status 0, PIPESTATUS collapse) is already fixed at this base by merged #3720 (e3a7b7b, model a pipeline member's spawn failure as a dead child, Refs #3091): the issue repro runs GNU-identical on the base Linux build and this nail is green on the base. This commit lands only the regression pin so #3550 can close with evidence. Nail provenance: tests 1-9 adopted verbatim from PR #3607's tests/issue3550_pipeline_spawn_failure.rs (closed unmerged as a duplicate of #3720; its 9 tests were verified 9/9 on master c3bf91e in that PR's round-2 audit but never landed). Tests 10-11 are this lane's additions (plain-command control, explicit PIPESTATUS slot-count lock). GNU anchors: execute_cmd.c:2620 execute_pipeline (each element via execute_simple_command -> execute_disk_command); execute_cmd.c:6143 shell_execve names the search_for_command result; execute_cmd.c:6126-6159 ENOENT -> 127. Expectations are GNU bash 5.3.20 outputs, re-verified with the vendored 5.3.20 oracle. UNVERIFIED-BY-CAPTAIN
caomengxuan666
added a commit
that referenced
this pull request
Nov 18, 2026
test: land rubash#3550 stale-hash pipeline-member pins (Refs #3550) Pin-only PR: 11 regression pins for #3550 (stale hashed path in a pipeline member: wrong ENOENT name, status 0, PIPESTATUS collapse). No product code changed (single file tests/issue3550_pipeline_spawn_failure.rs, +338/-0). Evidence: the three symptoms no longer reproduce on base 58c4cab; they were fixed by merged PR #3720. The pins pass 11/11 on this head's census (job 134702174402); fail-first was established by the lane on the pre-#3720 base (10 red), see ~/workspace/fix-3550/REPORT.md. Census note: this head's census total is 123, far above the era band (79-88). The +47 delta vs the pre-burst heads is in parser/quote/ comsub/EOF faces and belongs to the tip base (12-PRs merge burst 08:28-08:36Z), not to this pin-only diff: the pins themselves are 11/11 green and the diff touches no product code. The tip regression is tracked separately; #3878 was exonerated by its own head census (79 cells, issue3306 pins 9/9). 本 PR 删除了什么:无(纯新增测试文件)。
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
GNU forks every pipeline element (
execute_cmd.c:2620): when a child'sexecvefails it reportsshell_execve's classified verdict on its own fd 2 (EACCES → 126 "Permission denied", ENOENT → 127 "No such file or directory",execute_cmd.c:6126-6159) and exits;wait_for(jobs.c:3064) records it intoPIPESTATUSwhile the pipeline completes. Rubash's member spawners returnedErrand aborted the pipeline —PIPESTATUScame out empty andfile_name()dropped the as-typed./(findcmd.c:385-387keeps the attempted pathname for slash-bearing words, the resolved pathname for PATH-found ones).Every member spawn path now models the failed spawn as a pseudo-member via
Vec<Option<Child>>:member_spawn_failure(shared classifier citing the GNU ownership chain)PIPESTATUSslot; downstream stdin becomes EOFPaths covered: concurrent all-external spawners (both cfgs), shell-writer/producer-consumer, external-prefix streaming tail, streaming sandwich, and the sequential stage loop (
pipeline_stages.rs), where a dead member flagspipeline_stage_spawn_deadso the producer-SIGPIPE verdict applies GNU's race outcome — an in-process builtin's write beats the dead child's exit, an external/function/compound producer's does not.GNU oracle (WSL Bash 5.3.20, script-file dual-run)
Full probe matrix (first/middle/last member,
2>f,2>/dev/null,2>&1,|&,2>&-,>f 2>&1, merged-stream ordering) byte-identical to/usr/local/bin/bash.Test plan
cargo test --test issue3091_pipeline_spawn_failure_status— 8/8 green (WSL)cargo checkWindows + WSL clean; rustfmt cleanGenerated with Devin