Skip to content

[bug] 含斜杠的缺失命令:错误文案/errno 类错判(GNU: "No such file or directory";niubash: "command not found") #173

Closed

Description

@caomengxuan666

现象(生态车道 target-ecosys5,gvm init 链 + rbenv 跳板双现场)

对一个包含斜杠但不存在的命令词(绝对/相对路径形态),GNU bash 5.3.0 走 execve 的 ENOENT 分支,报 errno 文案;niubash 8f89767 报的是 PATH 未命中形态的 "command not found"。

同行对照(gvm scripts/env/gvm:44 调用 $GVM_ROOT/bin/gvm,该文件在 fixture 中不存在)

  • GNU: SB/fixtures/gvm-home/scripts/env/gvm: line 44: SB/fixtures/gvm-home/bin/gvm: No such file or directory
  • niubash: p06-gvm.sh: line 44: SB/fixtures/gvm-home/bin/gvm: command not found

(注意 niubash 侧归属文件名也是错的——顶层探针名,属 #162 归属族;本单只管 errno 文案类。)

rbenv 现场同型

  • GNU 对 exec ./../libexec/rbenv(缺失)→ No such file or directory
  • niubash → exec: ./../libexec/rbenv: not found

GNU 参考

execute_cmd.c execute_disk_command:命令词含斜杠时直接 execve;失败按 errno 报告(ENOENT → "No such file or directory")。仅无斜杠 PATH 搜索未果才报 "command not found"(127)。生态影响:安装器/初始化脚本的"缺文件"诊断被误报成"PATH 里没有",误导排障方向。

产物

D:/repo/rubash/target-ecosys5/results/p06-gvm/、results/p02-rbenv/

Activity

  1. added
    bug
    gnu-baseline
    on Sep 26, 2026
  2. caomengxuan666 commented on Sep 26, 2026

    @caomengxuan666
    MemberAuthor

    已在 52757ea 修复并关闭(6835852e):外部调度/管道段/exec builtin 三处按 findcmd.c:385-386(含斜杠绕 PATH 入 execve)+ execute_cmd.c:6126-6159(ENOENT→'No such file or directory' 127 / EISDIR 126 / EACCES 126)+ exec.def:151 full_pathname 语义修正。10 形态矩阵消息+退出码与 GNU 匹配(残余=平台路径显示族 /mnt/d vs D:/)。

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