Skip to content

[bug] Parser accepts mksh/zsh-only operators that GNU bash rejects: &| &>| &>>| >>| ;| (case fallthrough) <-> <5-10> #220

Closed

Description

@caomengxuan666

Found via mvdan/sh parser-corpus -n parity run (ecosuite lane; corpus extracted from mvdan/sh @ aebdf2b86f56f96eb885260bb03827aa5fc94ec4 syntax/filetests_test.go, 559 snippets; 16 diverge, this is family 1).

rubash -n returns 0 where WSL GNU Bash 5.3.0 returns 2 (syntax error) for mksh/zsh-only operators:

file input rubash GNU bash 5.3.0
t0068.sh `foo & + newline +bar` 0
t0142.sh foo >>|a &>|b &>>|c 0 2
t0143.sh foo >|a >>|b &>|c &>>|d 0 2
t0144.sh foo &>|a &>>c &>>|d 0 2
t0382.sh case i in 1) a ;| 2) b ;; esac 0 2
t0525.sh echo <-> 0 2
t0526.sh echo <5-10> 0 2

GNU C source: these tokens are not in bash's grammar (parse.y redirect operators are < > <> <& >& >> << >| &> &>> <<- and case terminators ;; ;& ;;&); ;| and &>>|/&>|/>>|-as->|-variant chains are mksh extensions, <->/<5-10> are zsh glob qualifiers mis-tokenized. rubash must produce a syntax error like GNU, not accept.

Artifacts: target/issue-suites/results/ecosuite/mvdan-n/ (matrix.txt 559 rows, diverge.txt 16, per-file .rub.err/.gnu.err), corpus under target/ecosuite/mvdan-corpus/.

Lane: wt4/ecosuite evaluation suites (no src/ fixes in lane).

Activity

  1. added 2 commits that reference this issue on Sep 27, 2026
  2. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    已修复并合入 master(commit d3e8aff,lane wt4/ecofix,GNU 引用见提交;探针/夹具与 WSL GNU 5.3.0 字节一致)。感谢报告!

  3. added
    bug
    area:parser
    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

    area:parserbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions