Skip to content

break 0 / continue 0 succeed instead of erroring (GNU: rc 1 + usage diagnostic) #395

Closed

Description

@caomengxuan666

Found during wt33 triage of #374 (executor_tests part_050).

Repro (script files, both shells)

Probes target/issue-suites/results/wt33-373/run/K031..K034 (test_break_zero_in_loop_*, test_continue_zero_in_loop_*):

while true; do break 0; done
echo rc=$?

WSL GNU Bash 5.3.0: break: 0: loop count out of range-style usage error, rc 1, loop NOT broken.
rubash: rc 0, loop exits (break 0 treated as break).

All four probes DIFF (gnu rc 1, rub rc 0). Raw artifacts in the K031-K034 .gnu/.rub pairs.

Activity

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

    @caomengxuan666
    MemberAuthor

    Landed as 4d2ca00: break 0/continue 0 out-of-range arms follow GNU break.def:75-83 / continue.def:120-128 — diagnostic + breaking = loop_level armed + EXECUTION_FAILURE (rc 1), the loop still unwinds and the rest of the body list is skipped (execute_cmd.c:635, :3840). Non-numeric args are the fatal EXITPROG path (common.c:488-515, interactive split). M1-M14+fatal matrices byte-identical to WSL GNU 5.3.0; tests 8/8; the #374 round's four part_050 ignores were lifted (their 'loop NOT broken' expectations contradicted both the C source and the GNU probes — K031-K034 were the corrupted extracts the round itself warned about); errors.snap re-recorded with GNU errors.right backing.

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