Skip to content

[bug] break inside a case-condition of while never breaks (modernish bin/modernish:866 infinite loop; GNU breaks) #256

Closed

Description

@caomengxuan666

Found by: wt5/omb lane, #252 follow-up. After the #252 comsub EXIT-trap fixes, modernish init (bin/modernish @ 63bdae0) proceeds past fatal.sh and now stops at line 866: while case $# in (0) break;; esac; do ... done (thisshellhas).

Reproducer (LF script file; GNU Bash 5.3.0 passes, prints loop-ok n=2; rubash emits 'break: only meaningful' and loops forever):

n=0
while case $n in (2) break;; esac; do n=$((n+1)); done
echo "loop-ok n=$n"

GNU owner: execute_cmd.c execute_case — loop_level is shell-global, so break anywhere inside the while CONDITION breaks the loop. Artifacts: target/issue-suites/results/wt5-omb/issue-probes/ (wt5/omb worktree).

Activity

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

    @caomengxuan666
    MemberAuthor

    已修复并合入 master(commit 2c126128/d1e598e0,lane wt6/shell2;验证:modernish .t 166/166 rc 向量满分(原 159/164)、bats filter.bats 全平价 6/6、#273 大小写修完零快照漂移、regression 24/24)。后续边界已开单跟踪。感谢报告!

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions