Skip to content

[tests] 三组回归钉期望与 GNU 不符(history 两钉 + exec 重定向钉)+ issue151 环境形钉——只改测试 #2175

Closed

Description

@caomengxuan666

性质

三条(组)回归钉的期望与 GNU bash 5.3.20 oracle 不符——产品行为与 GNU 逐字节一致,错的是钉。按错钉口径处理:只改测试、不动产品。发现路径:#2163 分诊(fix-2163-win-ci REPORT §3.4/§3.6 的 D3/D4/D7),主会话 2026-10-30 以 env -i 同条件双跑 oracle 与 master 构建逐条定谳。

1. history_builtin_rejects_extra_and_malformed_arguments(tests/cli_tests/compat_issue_regressions.rs)

钉期望 stdout 含 r1=2 与 r3=2 两行。GNU 实测:这两行不存在——history 10 42 与 history 5 abc 的错误路径走 DISCARD,同行其后的 ; echo "rN=$?" 根本不执行。rubash 输出与 GNU 逐字节相同(r2=2/r4=2/r5=1/r6=1、清单 7/8 行、六条错误行、rc=0 全对齐)。改钉:删去 r1/r3 两行期望(或按 GNU 形状重写该两行的探针结构)。

2. history_append_without_histfile_reports_failure_and_continues(同文件)

钉期望 stderr 含 history: filename not specified。同条件实测两边均为 history: HISTFILE: parameter null or not set(HISTFILE 未设时),stdout pre/AFTER 与 rc=0 两边一致。钉文案与 GNU 不符。改钉前先确认测试夹具的环境口径(harness 是否设 HISTFILE 为空串——空串与未设在 GNU 是两条不同错误路径),按夹具实况对齐 GNU 文案。

3. c_exec_keeps_stdout_redirect_after_invalid_expanded_option(tests/cli_tests/fd_redirects.rs)

探针:fd=-1; exec $fd>FILE; echo after。钉期望 stdout 为空、FILE 内容为 after(即 exec 失败但其重定向保留生效)。GNU 实测恰好相反:stdout 得到 after、FILE 为空——-1 作为 exec 的非法选项使整个 exec(含其重定向)被丢弃,shell 以原 stdout 继续。rubash 与 GNU 完全一致(stderr exec: -1: invalid option 两边同)。改钉:按 GNU 形状改期望(stdout=after\n、FILE 空)。

4. 附带观察:issue151_interactive_dash_c_includes_h_letter

期望的 $- 不含 m,但在本 VM(授予 job control 的 runner)上纯 master 即红、且失败形状与环境一致(实测 flags=himBHc)。这是期望依赖 runner 是否授予 job control 的环境形钉;与上三条同批处理时评估:按夹具实况条件化,或在钉内先固定 job-control 条件。

归宿

并入补钉批次(与 reopen-trap 两钉、s5 open_fds 钉同一波次),只改测试文件;改后须在 fd-9 关闭串行条件下复跑 cli_tests 相关面确认。

Activity

  1. added this to the 1.5.0 milestone on Oct 30, 2026
  2. added
    P3-low
    tests
    on Oct 30, 2026
  3. added a commit that references this issue on Oct 30, 2026
  4. caomengxuan666 commented on Oct 30, 2026

    @caomengxuan666
    MemberAuthor

    四组错钉全部按 GNU 5.3.20 oracle 订正,PR #2189 合入 master(merge acf8fef),CI 全绿,只动测试、零产品字节。

    • history 参数钉:原期望含 r1=2/r3=2 两行——GNU builtins/common.c:139 no_args() 在参数过多路径 jump_to_top_level(DISCARD),尾随的 ; echo "rN=$?" 根本不执行(错误文本仍入重定向文件,故错误块保留)。master 产品输出与 GNU 逐字节一致,删去两行期望。
    • history -a 钉:原期望 history: filename not specified 是错文案。GNU 在 HISTFILE 未设与空串两条路径上同为 history: HISTFILE: parameter null or not set(分别实测);期望改此文案,并给夹具加 .env_remove("HISTFILE") 钉死未设路径,与运行器父环境无关。
    • exec 重定向钉:原期望断言失败的 exec 其重定向留存——GNU 真值相反:exec $fd>out.txt(fd=-1)失败时整个 exec 被丢弃,重定向不生效(out.txt 被创建但为空、stdout 照常输出 after)。期望翻面,钉改名 c_exec_invalid_expanded_option_discards_redirect_and_keeps_stdout 以述真值。
    • issue151 flags 钉:原钉死 flags=hiBHc——GNU 在会话首领带控制终端时给 himBHc(m 为环境授予的作业控制字母,与本单 item 4 的怀疑一致)。钉改:抽取 flags 值、只接受 hiBHc/himBHc 两拼写,受护的 H 形状不变、其余字母漂移仍判红。姊妹钉(-m 调用形)留原样(当前 harness 下合 GNU),其同型潜伏面已在簇 REPORT 注明。

    同批附带:reopen-trap 的 issue1034 两钉移植入库(GNU 双跑一致,2/2 绿);s5 open_fds 钉改 delta 式(与原分支 hunk 逐字节同 blob)。两支来源分支已删。

    副渔(产品问题,已另行立案):issue1124 的五钉未入库——三钉在 master 红且根因在产品:__RUBASH_TRAP_ORIG_IGN 的启动消费丢弃裸数字载荷(bionic 空洞信号的唯一拼写)与短名(USR1),只有自家全名拼写(SIGRTMIN+4)被认。活路径与 GNU 逐字节一致、坏的是运输路径。钉文件保存在 ~/workspace/pin-backfill-batch/issue1124_pins_held_out.rs,随产品修复一并入库。簇报告 ~/workspace/pin-backfill-batch/REPORT.md。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P3-lowtests

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions