Repository navigation
fix(executor): keep GNU dead-fork shape when a pipeline member's spawn fails - #3607
caomengxuan666 wants to merge 1 commit into
Conversation
…n fails (Refs #3550) GNU forks EVERY pipeline element (execute_cmd.c:2620 execute_pipeline -> execute_simple_command -> execute_disk_command), so an execve refusal is reported by the member's own fork on ITS fd 2 — shell_execve names the execve filename (resolved PATH spelling for searched names, execute_cmd.c:6143; typed word for slash-bearing names, findcmd.c:385-387) — and exits 127 on ENOENT else 126 (execute_cmd.c:6126-6159), with the element's own 2> redirects applied in the fork first (redir.c:237). PIPESTATUS keeps the dead member's slot and its neighbours see the dead end's EOF. Every concurrent spawn site previously collapsed the member's spawn failure into a propagated IoError (`mycmd: <posix-msg>`) that lost the report_prolog prefix, the resolved-name spelling, the member's status slot, and the EOF handoff — `hash mycmd; rm bindir/mycmd; mycmd | cat` printed `case.sh: N: mycmd: ...` and PIPESTATUS `0` instead of GNU's resolved-path diagnostic and `127 0`. Each spawn site now records a virtual member: the GNU diagnostic built through the shared spawn_error_diagnostic + prefix + report_name construction is delivered to the surface the member's fd 2 was bound to (ambient stream written live, Direct handles dup'd and written, captured pipes ride the result slot or relay in member order with the stderr drains, and the stage spawner routes through the element's own 2> redirects), and status 127/126 lands in its results/statuses slot. processes lists carry (member_index, Child) pairs so a dead member's neighbours keep their pipe ends — dropped handles and an explicit dead pipe reproduce the dead fork's EOF. Verified byte-identical against vendored GNU bash 5.3.20 across the first/middle/last member, shell-writer, streaming-sandwich, member 2>file, member 2>&1, ambient exec 2>&1, comsub capture, brace-group and ! negation faces. Nine new pins in tests/issue3550_pipeline_spawn_failure.rs. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
【WIN-AGENT-AUDIT】 合入阻塞(不合、不关):
机制核查:
腿:
F 点:无(未发现机制错误;但 Linux 面未验证,不能给 PASS)。 未跑/VOID 的腿:
处置建议:rebase 解两文件冲突 → 在 Linux(或队长 oracle)上跑 |
|
【WIN-AGENT-AUDIT】 结论:本 PR 的全部验收面已在 master 证据:
腿:
未跑/VOID 的腿:无(Windows 侧 0 格属 |
|
【WIN-AGENT-AUDIT】PR #3607 第3轮(y4)— 建议:关闭(superseded;机制已由已合入的 #3720 完整覆盖,非代码缺陷判词) 复核(不接续作、不动分支):
判词:建议 owner 以 superseded 关闭本 PR;issue #3550 是否可关由队长按 #3720 的覆盖度裁定(本 lane 不动 issue)。 |
|
评审结论:SKIP — superseded(与已合入的 #3720 重复),不合入,不关闭。 为什么master 已有 合并冲突本身也说明了重叠: 证据(取 master 侧两个冲突文件,保留本 PR 的 pin 文件)
下一步
|
|
【WIN-AGENT-AUDIT】 复核(不接续作、不动分支):
建议 owner 关闭本 PR(与已合入 #3720 重复实现);issue #3550 是否可关由队长按 #3720 覆盖面裁定(本 lane 不关单、不合并)。 |
|
【WIN-AGENT-AUDIT】
阻塞项:#3685 等作者 rebase;#3701 ANSI-C 半边等队长处置 continuation.rs;#3744 等作者/队长执行 pins-only rebase;#3652 CI hygiene 红需下次 update-branch 消 stale-base。 |
|
【WIN-AGENT-AUDIT】superseded 建议关闭 f3 车道复核(2026-11-17 20:0x +08,master a41909d):
建议:owner 关闭本 PR(superseded,非代码缺陷判词)。若 #3550 尚有 #3720 未覆盖的格子(如 sandwich |
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
Summary
Refs #3550. GNU forks every pipeline element (execute_cmd.c:2620), so a member whose execve is refused reports shell_execve's errno on its own fd 2 — naming the resolved PATH spelling — exits 127/126, and keeps its PIPESTATUS slot while neighbours see the dead end's EOF. The concurrent spawn sites instead collapsed the failure into a propagated
IoError(mycmd: <posix-msg>), losing the prolog prefix, resolved name, status slot and EOF handoff. Every spawn site (concurrently, spawn_wait, streaming tail, shell-writer, sandwich, sequential stage spawner) now records a virtual member: sharedspawn_error_diagnostic+ prefix + report_name delivered to the member's own fd-2 surface (ambient live write, dup'd Direct handle, captured pipe result slot / in-order stderr relay, element2>redirects viadeliver_stage_diagnostic), with 127/126 in its results slot. Verified byte-identical vs vendored GNU bash 5.3.20 across 18 faces; 9 new pins.