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
{{ message }}
Repository navigation
[bug] Spurious syntax error: { case...esac; cmd # comment } — brace group fails to close after case + trailing comment (kills modernish launcher parse) #219
Found via modernish test suite (ecosuite lane). rubash -n rejects bin/modernish wholesale (rc=2), while GNU bash 5.3.0 accepts it. Reduced to a 7-line minimal form.
Minimal reproducer (WSL GNU Bash 5.3.0 = oracle)
p37.sh:
{
case x in
( s ) one
;;
esac
echo hi # comment
}
GNU bash 5.3.0 bash -n p37.sh: rc=0
rubash rubash.exe -n p37.sh: rc=2, line 2: syntax error: unexpected end of file from '{' command on line 1
Ingredients (reduction matrix saved under target/issue-suites/results/ecosuite/modernish/probes/)
{ ... } brace GROUP required: same body in a function f() { ... } parses fine (p44), no wrapper parses fine (p38).
a case...esac earlier in the group is required (p43 { echo hi # comment } alone is fine; p42 if..fi variant is fine).
the comment must be the last content before the closing } (p40, which adds one more command after the comment, is fine).
leading-paren case arms, &, fd-redirects, while/let not required (p34 still fails with none of them).
In the wild this appears as: modernish bin/modernish script-side die() body — { { ...trap loops... put ... >| /dev/tty ...; if ! is onterminal 2; then ...; fi } & } 8<&0 nested inside a case $- in ( * ) arm — reported by rubash as line 307: syntax error near unexpected token 'then' with the preceding lines folded into one; the whole 2700-line launcher then refuses to parse. Same file passes GNU bash -n.
GNU C source owner
parse.y:1196 group_command: '{' compound_list '}' — the lexer skips comments as whitespace; a #... line inside a compound list cannot extend or close the group. rubash's brace-scan/termination logic (cf. HEAD 9bf2df9 "resumable brace-scan cache") must not let a trailing comment before } poison the close detection after a case statement.
Activity
ecosuite fixes: #218 assignment-RHS backslash data, #219 comment newl…
caomengxuan666 commentedon Sep 27, 2026
已修复并合入 master(commit d3e8aff,lane wt4/ecofix,GNU 引用见提交;探针/夹具与 WSL GNU 5.3.0 字节一致)。感谢报告!