You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the script-file argument cannot be opened, rubash reports the right diagnostic but exits with the wrong status: 1 where GNU bash 5.3.0 exits 127 (missing file, ENOENT) or 126 (directory / non-ENOENT). The status code is contractual: make, CI drivers and test harnesses branch on 127 vs 126 vs 1.
Found by the corpus3 lane while running the OpenSSH 9.9p2 configure comparison (a mistyped corpus path exposed the divergence), then minimized.
Owning GNU code
third_party/bash/shell.c:1572 open_shell_script() — on open failure:
with shell.h:66 #define EX_NOTFOUND 127 and shell.h:65 #define EX_NOINPUT 126. The directory case is the same function, slightly below (file_isdir → sh_exit (EX_NOINPUT)).
Probe (identical invocation on both shells, script-file methodology)
stderr bash: missing.sh: No such file or directory, rc=127
stderr ...: missing.sh: No such file or directory, rc=1
bash missing.sh (exec)
same stderr, rc=127
same stderr, rc=1
bash <existing-directory>
...: Is a directory, rc=126
...: Permission denied, rc=1
Raw GNU oracle output (WSL):
$ /usr/local/bin/bash -n /tmp/definitely-missing-file-xyz.sh ; echo "gnu -n rc=$?"
/usr/local/bin/bash: /tmp/definitely-missing-file-xyz.sh: No such file or directory
gnu -n rc=127
$ /usr/local/bin/bash /tmp/definitely-missing-file-xyz.sh ; echo "gnu exec rc=$?"
/usr/local/bin/bash: /tmp/definitely-missing-file-xyz.sh: No such file or directory
gnu exec rc=127
Note the directory case also diverges in message text (Is a directory vs Permission denied) — that part is Windows errno rendering (opening a directory yields EACCES on Windows) and may be platform-bound, but the exit-status mapping is rubash-caused and fixable regardless of the errno question.
Fix direction
Map script-open failure exit status per open_shell_script: ENOENT → 127 (EX_NOTFOUND), other open errors → 126 (EX_NOINPUT). Fixture: tests/fixtures/corpus3/repro/script_open_exit_status.sh.
Artifacts: target/issue-suites/results/corpus3/results/openssh-n/ (accidental live capture: gnu rc=127 vs rub rc=1 on identical missing-path args), work/missing-probe.sh, work/dir-probe*.sh
Activity
builtins lane: ulimit real engine, declare -i DISCARD, time/select/re…
caomengxuan666 commentedon Sep 27, 2026
已修复并合入 master(commit 2c78889b,lane wt6/builtin2;GNU 引用与全矩阵验证见提交——回归 24/24、set-e/set-x/errors 真基线平价)。感谢报告!