You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closing — the §8 residual (≥3-stage stage-0 bindings) is fixed by PR #2289 (merge commit c537d12), completing the issue. The earlier faces landed via PR #2262 and PR #2284; this comment covers the final segment and the two extra mechanisms it exposed.
§8 input face. In a ≥3-stage pipeline, stage 0's numbered input binding was lost entirely. Root cause (strace-proven): the shell-writer pipeline admission never inspects the ordered redirects list; it spawned the consumers on pre-created pipes before running the producer, so a foreign pipe end parked exactly on the binding's slot and the pin_ambient_fds_in_child guard (#1626/#2284) could not distinguish it from std's exec-error channel — the delivery opened the binding, the dup2 never ran. Fix: the shell-writer path now declines an external producer carrying a list-only redirect (fd > 2 or {var}), so the sequential loop spawns stage 0 in a clean fd layout and the shared delivery lands. The decline exempts pure stdio dups (the writer path delivers those correctly at 2 stages).
Second mechanism found during the fix — output wipe. Stage numbered output was also broken, differently: the child's bytes landed in the target file and were then truncated to 0 after the stage exited, because route_pipeline_stage_streams re-runs the ordered output walk post-stage and its create/truncate validation open (the #1868 dropped-File model) fired for numbered targets the element had already written directly. On master this wiped mid- and last-stage numbered output too. Fix: OutputFdState::resolve_only_numbered — in routing mode the walk still resolves the whole list but records fd > 2 targets with no filesystem open. GNU opens once per redirection, in the fork (execute_cmd.c:2620, redir.c:237).
Verification. Collector batch under a scrubbed fd environment on the composed tree: tests/issue2255_pipeline_stage_redirects.rs 14/14 (the original 7 + §8 three/four-stage input + stage-0 output + middle/last-stage output + dup-chain pins); controls issue1963 6/6, issue2235 11/11, issue2250 5/5, issue2256 25/25; streaming spot checks (yes | head -3, yes | head -1 | wc -l) intact. CI green on the branch head (09937fd) and on the composed head (4c3a0e8). A 19-case GNU battery matched 17; the 2 remaining diffs are byte-identical on master (pre-existing) and are filed as #2294 and #2295; the sequential-spawner stdio-dup gap is filed as #2293; the consumer-chain pipe-end leak observation went to the audit ledger.
Activity
caomengxuan666 commentedon Oct 30, 2026
已修复并合并:PR #2262(合并树 CI 全绿;主会话在 #2253+#2262 复合树上实跑 7 枚钉全绿——含必须两单同在的 e8/f6b 与 procsub 钉)。
定性:管道 stage 自带重定向时,stage runner 没走 spawn 的投递路径——fd-0 的 dup/close 胜者不被 stage 侧承认(#2235 电池的 e8/f6a/f6b 格)。
修复:stage runner 改走从 spawn 抽出的共享
apply_external_fd_delivery助手(不许 stage 侧平行实现),fd-0 dup/close 胜者就此被承认。与 #2253 的复合关系已在钉文件头逐格标注并双向验证。REPORT 残面处置:①fd-0 close 在 inline 臂不可表达——属观察记录、非已证分歧,不立案;②inline-stage 编号输出绑定的创建副作用——同上,先记入全仓审计线备查,两者均待审计批次以探针定性后再决定是否立案。
caomengxuan666 commentedon Oct 30, 2026
重开本单:PR #2262 的关单验证被环境掩盖,本单的核心主张只兑现了一部分。裁定全文在
~/workspace/adjudicate-2255-stage-reds/REPORT.md,要点:两枚红钉的裁定(主会话批复跑坐实)
issue2255_pipeline_stage_redirects在当前 master 确定性 5/7,红的是 f6a(sh -c 'cat <&3' 3<seed.txt | wc -c应得 10、实得 0)与编号输出(3>o.txt应把 o 写进文件、实得 o 漏进下游管道)。两钉经 oracle 逐字节核对是对的;产品自钉子写就的那一提交(afc1845a)起就红——不是任何后续合并的回归。关单时记录的 7/7 是真实观察、但只在启动器继承了额外 fd 的布局下成立:stage 的 stdout 管道恰好不落在 3 号槽,守卫不误伤。干净 fd 布局下管道确定性落在 3 号槽,红就出现。教训:fd 敏感钉的绿依启动器 fd 布局而定,批验证必须在洗净 fd 的环境下做并记录。
根因与已备修复
pin_ambient_fds_in_child(#1626 引入的守卫)无法区分 exec-error 管道与 stage stdio 管道在目标槽上的残留:stage 子进程里 std 先把 stdout 管道 dup2 到 1、原号(此处 3)留到 exec 才关,fstat 分不出它与错误通道,于是目标槽停着匿名管道时 pin 被静默丢弃——即 GNU 给该 stage 的重定向被牺牲。简单命令面靠布局运气(投递自己的 open 常落在 3、源==目标短路)逃过。修复已备:草稿 PR #2284——守卫改为以 fstat 的 (dev, inode) 身份与 0/1/2 比对来精确识别 stdio 残留,错误通道永不匹配、保护不减。主会话按标准收割流程处理。
本单剩余范围(#2284 落地后仍开着的理由)
≥3 级管道的 stage-0 编号输入仍丢绑定(裁定 §8,独立面):
与两钉的 pin-守卫面不同:这个组合里 stage 0 走的是另一条 spawner 路,绑定从未投递。对照边界:2 级 stage-0 由 #2284 修;3 级的中间 stage 编号绑定今天就是好的。归宿:定位 ≥3 级组合中 stage 0 的实际 spawner 面并补投递,复现形如上,期望取 GNU。
#2284 合并后本单保持 open,直到此面落地。
fix(2255): widen pipe identity fields to u64 for 32-bit Android
fix(2255): routing walk resolves numbered stage outputs instead of re…
caomengxuan666 commentedon Oct 30, 2026
Closing — the §8 residual (≥3-stage stage-0 bindings) is fixed by PR #2289 (merge commit c537d12), completing the issue. The earlier faces landed via PR #2262 and PR #2284; this comment covers the final segment and the two extra mechanisms it exposed.
§8 input face. In a ≥3-stage pipeline, stage 0's numbered input binding was lost entirely. Root cause (strace-proven): the shell-writer pipeline admission never inspects the ordered redirects list; it spawned the consumers on pre-created pipes before running the producer, so a foreign pipe end parked exactly on the binding's slot and the
pin_ambient_fds_in_childguard (#1626/#2284) could not distinguish it from std's exec-error channel — the delivery opened the binding, the dup2 never ran. Fix: the shell-writer path now declines an external producer carrying a list-only redirect (fd > 2 or{var}), so the sequential loop spawns stage 0 in a clean fd layout and the shared delivery lands. The decline exempts pure stdio dups (the writer path delivers those correctly at 2 stages).Second mechanism found during the fix — output wipe. Stage numbered output was also broken, differently: the child's bytes landed in the target file and were then truncated to 0 after the stage exited, because
route_pipeline_stage_streamsre-runs the ordered output walk post-stage and its create/truncate validation open (the #1868 dropped-File model) fired for numbered targets the element had already written directly. On master this wiped mid- and last-stage numbered output too. Fix:OutputFdState::resolve_only_numbered— in routing mode the walk still resolves the whole list but records fd > 2 targets with no filesystem open. GNU opens once per redirection, in the fork (execute_cmd.c:2620, redir.c:237).Verification. Collector batch under a scrubbed fd environment on the composed tree: tests/issue2255_pipeline_stage_redirects.rs 14/14 (the original 7 + §8 three/four-stage input + stage-0 output + middle/last-stage output + dup-chain pins); controls issue1963 6/6, issue2235 11/11, issue2250 5/5, issue2256 25/25; streaming spot checks (
yes | head -3,yes | head -1 | wc -l) intact. CI green on the branch head (09937fd) and on the composed head (4c3a0e8). A 19-case GNU battery matched 17; the 2 remaining diffs are byte-identical on master (pre-existing) and are filed as #2294 and #2295; the sequential-spawner stdio-dup gap is filed as #2293; the consumer-chain pipe-end leak observation went to the audit ledger.fix(executor): let fd pins win slots held by stdio pipe leftovers (ru…
fix(2255): decline shell-writer path for stage-0 producers carrying o…
fix(executor): route pipeline stages with a write-only dup winner to …