Skip to content

test(issue4254): pin arithmetic-error diagnostics following function stderr redirects - #4280

Merged
caomengxuan666 merged 1 commit into
masterfrom
captain/4254-arith-error-pins
Nov 29, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
captain/4254-arith-error-pins

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

概要

Refs #4254。UNVERIFIED-BY-CAPTAIN(车道交付,待队长复核)。

#4254(函数内算术求值错误诊断绕过函数的 stderr 重定向)在当前 master 上已经修复:车道在 devin-mac 上以云端 GNU bash 5.3.20 tarball oracle 为对照,对原形 + 相邻面共 32 个探针脚本逐字节比对(stdout/stderr/rc/产物文件),全部一致。本 PR 不改源码,只把这组已验证行为钉成回归测试,防止再退。

本 PR 内容

  • 新增 tests/issues_4200_4299/issue4254_arith_error_follows_function_stderr_redirect.rs(6 条):
    • 原形:诊断入 err.txt、脚本 stderr 空、调用 rc=1、脚本继续;
    • 仅重定向 stdout 时诊断不被捕获;
    • 错误只弃当前命令列表(DISCARD),跨行继续;
    • (( )) 与 let 的诊断同样跟随函数 stderr 重定向;
    • 嵌套函数错误连调用方当前列表一并弃、脚本继续;
    • declare -i 求值错误同样跟随重定向。
  • tests/issues_4200_4299.rs 注册该模块(+2 行)。

本 PR 删除了什么

无。test-only 新增,不引入第二走法。

净行对账

+151 / −0(2 files changed, 151 insertions)。

验证(车道本地,macOS)

  • 新钉:6/6 通过;本桶全量 44/44(master 38 + 新 6)。
  • Census 名集差分(同机背靠背):--lib 两侧均 1341 passed / 0 failed;本桶 38→44 全绿;SIGABRT 两侧 0 处。goldens 为 Windows-only 面,macOS 不出现,留 CI。
  • 证据卷宗:lane-4254-fix-2026-11-30.md(32 探针矩阵与逐字节 diff 结论)。

备注

#4254 本体建议由队长按「master 已修复」关单(issue 上已有 @55b0aebb 的 Windows/WSL 验证评论,本 PR 的钉子为 macOS 侧的同面证据)。

…stderr redirects

Test-only. The reported bug (arithmetic eval error diagnostics bypass
the calling function's stderr redirect) does not reproduce on master
60ed70e: 32 probe scripts on macOS run byte-identical against the
GNU bash 5.3.20 oracle, including the nested-caller DISCARD face.
Adds 6 regression pins so the face stays covered.

Refs #4254 (not Fixes).
@caomengxuan666
caomengxuan666 merged commit d5d939f into master Nov 29, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant