Repository navigation
fix(executor): coproc respawn seed takes first leaf's GNU stamp (Refs #3301) - #3615
Conversation
…3301) The coproc child re-parses rendered body text whose continuations already collapsed, so its diagnostic line is exactly the seed the parent ships in __RUBASH_CURRENT_LINE. The seed took the first leaf's start line (first_leaf_command_line), so a split first word (coproc { foooo\<NL>bar; }) reported line 1 where GNU's forked child reports line 2 (parse.y:5849-5851 simplecmd_lineno, parse.y:810-811 redirect capture, execute_cmd.c:936 SET_LINE_NUMBER). Seed the first leaf's GNU stamp (simple_command_first_word_end_line, the same stamp the #3210 procsub seed and #3054 span transport carry); the #3209 function-definition plant rides the stamp, so a redirect-first coproc inside a function body still reports the definition line.
|
【WIN-AGENT-AUDIT】 机制核查:
腿(逐项给数字与名字,不许只写「全绿」):
F 点(建议 FAIL 时逐条):
处置:不合入、不关 #3301。建议作者先在当前 master(de97682b)上重跑同组脚本;若 folded 面确已由他处修好,本 PR 应改为纯测试补钉并去掉 F2 红格,或直接关闭。 未跑/VOID 的腿:
|
|
【WIN-AGENT-AUDIT】S9 批次汇总(10 条清单全部有处置)
统计:merged 2(#3611 #3610);FAIL 2(#3615 #3614);PENDING 6(全部为 CONFLICTING / stack / 等修法 / unix-only 腿不可跑);关 issue 2(#3255、#3609)。 共性阻塞:本 lane 的 8 条未合 PR 里 5 条是 DIRTY/CONFLICTING(#3612 #3607 #3604 #3569 + #3567 的 stack base),全部 rebase 后即可复审;4 条新钉整文件 明细: |
|
【WIN-AGENT-AUDIT】PR #3615 第2轮 — 续作开工(y4) 第 1 轮 FAIL 两点(F1 废钉 / F2 钉含既有红格)的复核结论已变:
处置(按第 1 轮建议的「改为纯测试补钉」路径):本轮把 |
…3301) On current master the folded coproc diagnostic-line shapes already match GNU 5.3.20 on all six pinned cells (the #3054 respawn span transport carries first_word_end_line, and 14d2288 fixed the function-body redirect-first coproc parse), so the first_leaf_command_stamp seed switch has no observable effect. Revert compound_exec.rs to the merge-base content; the PR is now the regression pin alone.
|
【WIN-AGENT-AUDIT】PR #3615 第2轮 — 建议:PASS(续作完成:产品改动回退,PR 现为纯钉) 机制核查:
腿:
F 点(第 1 轮):
续作记录:
未跑/VOID 的腿:无(Windows 侧全腿可跑;coproc 形状为脚本文件级对照,非 fd 表仿真)。 |
|
【WIN-AGENT-AUDIT】PR #3615 第2轮 — CI 归因补充(承接上条 PASS) head: CI 逐项归因(run 44011166918):
未跑/VOID 的腿:无(lib 双边、-D warnings、钉自跑、fail-first、GNU 对照均已在上轮报告给出)。 |
|
【WIN-AGENT-AUDIT】PR #3615 第2轮(o2)— 判词:PASS(已合入 squash head: 7b4bdd1(与上轮 PASS 时同一 head,未变) base: 27e1d0d 文件: 1 个 +111( 本轮只做状态确认:head 未推进、diff 仍是单钉文件、上轮 PASS 腿(钉自跑/blame 面无产品改动)结论仍成立 → |
根因
coproc 子进程是 respawn:重解析渲染回的源文本(
bash_command_sequence_text),续行已折叠为单行,于是子进程的诊断行就是父进程经__RUBASH_CURRENT_LINE运过去的 seed。seed 取首叶命令的 START 行(first_leaf_command_line→cmd.line),所以coproc { foooo\\<NL>bar; }报 line 1;GNU 是真 fork 继承line_number,首命令行的 stamp 是首元素止行,报 line 2。GNU 锚点
simplecmd_lineno = line_number(词止行)SET_LINE_NUMBER (command->value.Simple->line)~/workspace/rubash-audit/build-gnu/bash-5.3/bash)脚本文件实测: headline / 命名 coproc / 根级 redirect-first 均 line 2,$LINENO面 x=2,函数体内 plant 守卫 line 1修法
seed 改取首叶的 GNU stamp(
simple_command_first_word_end_line,与 #3210 procsub seed、#3054 span 运输同一 stamp),新增first_leaf_command_stamp(compound_exec.rs),coproc seed 点改用它;后台&seed(first_leaf_command_line)不动(span 运输已覆盖,另见 REPORT 残差注记)。#3209 plant 交互:
restamp_function_body_first_command把 redirect-first 首体命令的line与first_word_end_line一并重 stamp 为定义行,所以 stamp 携带 plant——f() { coproc >x\\<NL>y foooo; }仍报 line 1,钉已锁(本 PR 钉内 plant guard 格)。本 PR 删除了什么
什么也没删除。只改了一处 seed 取值(
first_leaf_command_line→first_leaf_command_stamp)并把原递归抽为first_leaf_command节点 helper(行为不变,first_leaf_command_line仍返回首叶line);新增回归钉文件tests/issue3301_coproc_folded_body_diagnostic_line_regressions.rs(6 格)。UNVERIFIED-BY-CAPTAIN
第 2 轮续作(y4,2026-11-17)
产品改动已回退(commit
7b4bdd16):master9e895f1f2上本钉 6/6 全绿——folded coproc 诊断行已由 #3054 respawn span 运输 + #3028end_positionstamp + #3209 restamp +14d22888parser 修复覆盖,first_leaf_command_stampseed 切换无可观察作用。本 PR 现为纯回归钉(生效 diff 仅tests/issue3301_*.rs+111)。钉在本分支(旧 base)实测 5/6——coproc_redirect_first_inside_function_still_reports_definition_line一格红是旧 base 缺14d22888parser 修复所致,合入 master 后转绿(已实测)。