Repository navigation
fix(executor): keep __RUBASH_*_VARS attribute transport off the exec boundary (Refs #2983) - #3653
caomengxuan666 wants to merge 2 commits into
Conversation
…boundary (Refs #2983) Root cause: the `__RUBASH_*_VARS` variable-attribute transport keys (internal cross-process state for fork-substitute respawns) were projected into every external child's environment by compose_child_environment, because the process-env mirror projection kept every `__RUBASH_*` name. A descendant rubash re-imported the keys via VarTable::from_values and recreated the parent's non-exported readonly/array attributes in a process that is not a fork substitute. In bats #8 this handed the nested bats run a readonly BATS_TEST_TAGS, crashing it at test_functions.bash:531 before any test ran, so teardown_file never ran and the LOG was missing. GNU anchor: variables.c:4850 make_env_array_from_var_list passes only exported variables to a child (arrays/assocs `continue`, "XXX array vars cannot yet be exported", ARRAY_EXPORT off); execute_cmd.c:1761-1763 (async child is a fork inheriting the table whole — the wrapper respawn is the fork substitute and keeps the keys via env_vars_snapshot). Bisect: NOT a merge regression. 8eb0787..6171293 is exactly 3 commits (#3455/#3220/#3621) and the parent 8eb0787 fails #8 identically (2/2, line 118) on a genuine rebuilt binary, so none of the three is the culprit. #3455 did not change the wait/signal path implicated here. Fix: exclude the `__RUBASH_*_VARS` keys from the mirror projection in compose_child_environment (one predicate + one skip arm). All consumers of that body are exec boundaries (foreground external, direct async spawn, external pipeline stage, external in comsub); no fork-substitute respawn uses it. Regression pin: tests/issue2983_bg_child_readonly_array.rs (2 cells). Fail-first on unfixed tip (both `declare -ar MYARR`, rc=1); green on fixed tip and GNU. The child script is shebangless by design (a shebang'd child is exec'd via its shebang under the system bash and never shows the transport). Status: fix #1 of 2. Bats #8 still fails on this head (line 118) pending fix #2 (background-wrapper SIGINT relay — the wrapper dies on a group-delivered SIGINT before its foreground script child runs its INT trap; PDEATHSIG SIGKILLs the script). Fix #2 is designed but guard-blocked (open PRs touch src/executor/external_inner.rs); see REPORT.md in the lane workdir. UNVERIFIED-BY-CAPTAIN. 本 PR 删除了什么:无。本 PR 只增加代码(33 行插入,0 行删除)与一枚新回归测试文件;不删除任何功能、文件、测试或公开 API。
|
【WIN-AGENT-AUDIT】 机制核查:
腿:
F 点:
续作记录:本轮未动代码(按分工,FAIL 只发报告)。 |
|
【WIN-AGENT-AUDIT】T3 续作开工(第 2 轮) 按 S 波 FAIL 判词返工,本轮计划:
改完跑第 4 节相关腿后 push(不 force-push),再发 REWORK 报告。 |
|
【WIN-AGENT-AUDIT】PR #3653 第2轮 — REWORK 完成,建议:PASS(待 CI 复核 Windows compile check) 续作记录:
F 点逐条回应:
腿(本轮增量;产品面零改动,沿用第 1 轮已核结论):
未跑/VOID 的腿:无(Linux 行为腿已由 WSL 补齐;Windows 侧该钉按设计 0 tests)。 |
|
【WIN-AGENT-AUDIT】PR #3653 第3轮 — 建议:PENDING(机制面已被 master #3736 覆盖,需队长裁断去留) 本轮新发现(决定性,改变判词):
含义:PR 的产品改动( 已完成的返工(保留在分支上,无论去留都正确):
建议队长裁断:
CI:本 head 两次 push 均未触发 Actions run(13:21/13:28Z 推送,疑似 Actions 事件丢包窗口;3636 同期推送 13:33Z 正常触发)。本地已覆盖等效腿,CI 缺口如实记录。 |
|
【WIN-AGENT-AUDIT】
阻塞/移交项:
环境注记:git fetch/push 期间代理 127.0.0.1 间歇故障,已用 |
|
【WIN-AGENT-AUDIT】 head: 32b9498(未变) 本轮复核(Z 波,收网第四轮,master 尖 a0a6d78):
未跑/VOID 的腿:本轮未重跑构建腿(master 机制覆盖结论由第 3 轮 Linux 实测 + 本轮 merge-tree/祖先核验支撑);CI 腿前轮已记 VOID(Actions 事件丢包)。 |
|
评审结论:SKIP — superseded,不合入,不关闭。
证据(本评审 worktree,merge
下一步
|
|
【WIN-AGENT-AUDIT】 本轮复核(f3 车道,master a41909d):
判词依据:PR 产品改动对已验证形状冗余(master 已修好目标缺陷),但 issue 未关、是否存在 未跑/VOID 的腿:本轮未重跑构建腿(master 机制覆盖结论由第 3 轮 Linux 实测 + 本轮祖先/issue 复核支撑;src 面本轮零改动)。 |
|
【WIN-AGENT-AUDIT】 #2983 实际缺陷清单(issue 正文 + 队长 11-14 分析评论)
本轮实测(master
|
|
【WIN-AGENT-AUDIT】PR #3653 第6轮(m1 裁决)— 关闭:superseded head: 32b9498(未变) 独立复核(master 59d1c2b 工作树,只读):
裁决:fix #2 relay 需另行立项(建议新 issue 跟踪 |
fix(executor): keep _RUBASH*_VARS attribute transport off the exec boundary (Refs #2983)
Root cause: the
__RUBASH_*_VARSvariable-attribute transport keys(internal cross-process state for fork-substitute respawns) were
projected into every external child's environment by
compose_child_environment, because the process-env mirror projection
kept every
__RUBASH_*name. A descendant rubash re-imported thekeys via VarTable::from_values and recreated the parent's
non-exported readonly/array attributes in a process that is not a
fork substitute. In bats #8 this handed the nested bats run a
readonly BATS_TEST_TAGS, crashing it at test_functions.bash:531
before any test ran, so teardown_file never ran and the LOG was
missing.
GNU anchor: variables.c:4850 make_env_array_from_var_list passes
only exported variables to a child (arrays/assocs
continue,"XXX array vars cannot yet be exported", ARRAY_EXPORT off);
execute_cmd.c:4550/5834 make_child (async child is a fork inheriting the table
whole — the wrapper respawn is the fork substitute and keeps the
keys via env_vars_snapshot).
Bisect: NOT a merge regression. 8eb0787..6171293 is exactly 3
commits (#3455/#3220/#3621) and the parent 8eb0787 fails #8
identically (2/2, line 118) on a genuine rebuilt binary, so none of
the three is the culprit. #3455 did not change the wait/signal path
implicated here.
Fix: exclude the
__RUBASH_*_VARSkeys from the mirror projectionin compose_child_environment (one predicate + one skip arm). All
consumers of that body are exec boundaries (foreground external,
direct async spawn, external pipeline stage, external in comsub);
no fork-substitute respawn uses it.
Regression pin: tests/issue2983_bg_child_readonly_array.rs (2 cells).
Fail-first on unfixed tip (both
declare -ar MYARR, rc=1); greenon fixed tip and GNU. The child script is shebangless by design
(a shebang'd child is exec'd via its shebang under the system bash
and never shows the transport).
Status: fix #1 of 2. Bats #8 still fails on this head (line 118)
pending fix #2 (background-wrapper SIGINT relay — the wrapper dies
on a group-delivered SIGINT before its foreground script child runs
its INT trap; PDEATHSIG SIGKILLs the script). Fix #2 is designed
but guard-blocked (open PRs touch
src/executor/external_inner.rs); see REPORT.md in the lane workdir.
UNVERIFIED-BY-CAPTAIN.
本 PR 删除了什么:无。本 PR 只增加代码(33 行插入,0 行删除)与一枚新回归测试文件;不删除任何功能、文件、测试或公开 API。