Skip to content

[Compat][BusyBox][ash-misc] Bash-compatible differences #49

Closed as not planned

Description

@caomengxuan666

Current Run

Commit: 5178166
Suite: BusyBox ash tests run through scripts/run-busybox-bash-difftest.sh
Directory: ash-misc
Result: 20 DIFF

Raw artifact: target/issue-suites/results/busybox-bash-5178166/

Initial Cause

Mixed builtin/control-flow status differences including case, pipefail, eval, exit/trap, function precedence, source and unicode; split each row before fixing; owners: executor/builtins/parser.

The result compares GNU Bash and Rubash with the BusyBox harness contract: THIS_SH, test-directory PATH, TMPDIR, helper binaries and per-test timeout. Host-only ash behavior is excluded. Each row still needs a minimal Bash-compatible reproducer before implementation.

DIFF Cases

case status bash_rc rubash_rc
ash-misc/assignment2 DIFF 0 0
ash-misc/break5 DIFF 0 0
ash-misc/case1 DIFF 0 2
ash-misc/continue1 DIFF 0 0
ash-misc/eval2 DIFF 0 0
ash-misc/exit1 DIFF 0 0
ash-misc/exitcode2 DIFF 0 0
ash-misc/exitcode_EACCES DIFF 0 0
ash-misc/exitcode_trap1 DIFF 0 0
ash-misc/exitcode_trap2 DIFF 0 0
ash-misc/exitcode_trap6 DIFF 0 0
ash-misc/for_with_bslashes DIFF 0 0
ash-misc/func_prio_over_builtins DIFF 0 0
ash-misc/group_in_braces DIFF 0 0
ash-misc/nulltick1 DIFF 0 0
ash-misc/pipefail DIFF 0 2
ash-misc/read DIFF 0 0
ash-misc/source3 DIFF 0 0
ash-misc/tickquote1 DIFF 0 2
ash-misc/unicode1 DIFF 0 0

Acceptance

  • Classify every row as semantic, host/fixture, or runner.
  • Add a minimal Bash/Rubash regression for every semantic row.
  • Record the owning Rust subsystem and match stdout, stderr and status.
  • Keep the per-test timeout and residual-process check green.

Activity

  1. caomengxuan666 commented on Sep 7, 2026

    @caomengxuan666
    MemberAuthor

    复测(ca543d41):ash-misc 20 行 → 97 项目录 76 PASS / 19 DIFF / 2 TIMEOUT

    2f96d92(双引号内单引号字面数据)+ ca543d4(前缀赋值源顺序链式)后,本目录翻转回 GNU 一致:func_args1、local1。

    剩余 19 DIFF 中,真语义候选(GNU≈busybox)包括:

    • assignment2:a''=b true — GNU/bash rc=127(a=b: command not found,带引号的赋值名不是赋值),rubash 仍当作赋值接受;
    • exitcode2 / exitcode_EACCES / exitcode_trap1 / eval2 / continue2 / continue3 / source3 / func_prio_over_builtins / for_with_bslashes / shift1 / tickquote1 / unicode1 待逐行甄别(部分为三方分歧)。
    • heredoc_huge 实际已不挂起(gate TIMEOUT 为 10s 上限假象,复跑 rc=0)。

    复核产物:target/busybox-results/20260907T021443Z/(gate results.tsv、gnu-side/、rerun-side/、post-fix-match.txt、post-fix-stilldiff.txt、three-way-classification.tsv);树 = ca543d4。

  2. caomengxuan666 commented on Sep 7, 2026

    @caomengxuan666
    MemberAuthor

    已修复:assignment2(b4c8cca0)

    GNU 依据:parse.y read_token_word 调 general.c assignment() 在原始 token上逐字符判定,名字部分只允许 [A-Za-z0-9_],含任何引号/反斜杠即非赋值词。rubash 此前对去引号后的值判定(a''=b 去引号变 a=b),静默接受为赋值。

    修复:lexer/word.rs 改为按原始词名字判定;删除 assignment_dispatch.rs 的执行期重推导(execute_cmd.c 从不重推导 W_ASSIGNMENT)。脚本文件探针 7 例与 GNU 全对齐(rc 与 stderr 文本):

    a''=b true; a""=b true; "a"=b true; a\ b=x true; a''=b(裸行) → 全部 127 + "a=b: command not found"
    a=b true → 0
    

    lib 测试维持 325 过/10 已知基线失败;剩余 13 个 parser_tests 失败经 stash 对照确认为树上既有问题(与本修复无关)。

  3. caomengxuan666 commented on Sep 7, 2026

    @caomengxuan666
    MemberAuthor

    已修复:assignment2(b4c8cca0)

    GNU 依据:parse.y read_token_word 调 general.c assignment() 在原始 token上逐字符判定,名字部分只允许 [A-Za-z0-9_],含任何引号/反斜杠即非赋值词。rubash 此前对去引号后的值判定(a''=b 去引号变 a=b),静默接受为赋值。

    修复:lexer/word.rs 改为按原始词名字判定;删除 assignment_dispatch.rs 的执行期重推导(execute_cmd.c 从不重推导 W_ASSIGNMENT)。脚本文件探针 7 例与 GNU 全对齐(rc 与 stderr 文本):

    a''=b true; a""=b true; "a"=b true; a\ b=x true; a''=b(裸行) → 全部 127 + "a=b: command not found"
    a=b true → 0
    

    lib 测试维持 325 过/10 已知基线失败;剩余 13 个 parser_tests 失败经 stash 对照确认为树上既有问题(与本修复无关)。

  4. caomengxuan666 commented on Sep 7, 2026

    @caomengxuan666
    MemberAuthor

    批量复跑确认(b4c8cca0 二进制,104 个非 PASS 行全量重跑)

    • assignment2 翻转:stdout/stderr/rc 与 GNU 5.2.21 完全一致;
    • 此前已翻转的 15 行全部保持(零回归);
    • 当前累计:104 个曾差异行中 16 行与 GNU 一致,全库有效通过 229/335。

    产物:target/busybox-results/20260907T021443Z/post-fix-match.txt、post-fix-stilldiff.txt(其余 88 行的剩余根因分析进行中)。

  5. caomengxuan666 commented on Sep 11, 2026

    @caomengxuan666
    MemberAuthor

    Closing in favor of the GNU Bash 5.3.0 true-baseline measurement as the single compatibility yardstick (ledger: #62, status: docs/COMPATIBILITY-STATUS.md).

    Rationale: the BusyBox ash test directories are not GNU Bash upstream tests. GNU is the only suite family with a quantified baseline (83 suites, 2026-09-11 full rerun: 32 zero-diff suites, 2072 total diff lines), so per-family BusyBox/ksh93/mksh/Oil ledgers are no longer maintained in parallel.

    If any row in this run is later shown to be a real Bash-semantic gap, re-file it as a minimal Bash/Rubash reproducer against the GNU baseline ledger (#62). Raw artifacts remain under target/issue-suites/results/.

  6. added
    bug
    gnu-baseline
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions