Skip to content

[bug] ble.sh -n next blocker after #244/#245 fixes: 'line 28570: syntax error near unexpected end of file' (GNU rc=0) — context-dependent parse divergence in the ble-edit/io section #255

Closed

Description

@caomengxuan666

Corpus: ble.sh nightly-2026-09-27 (tests/fixtures/corpus2/corpora/SOURCES.txt, sha256 4b76374ad5d0bb5325315abc0d714d50b0dea7430108ed872cfcd1954d845808; artifact re-fetched from the pinned nightly tarball and verified byte-exact).

Status after the wt5/ble lane fixes (#244 mid-word braces, #245 driver heredoc/arithmetic): rubash -n ble.sh advanced past BOTH previous blockers (line 14525 } from #244, line 28355 } from the #245 group balloon) and now dies at a NEW site with a different error shape.

Reproducer (bounded):

timeout 120 target/debug/rubash.exe -n ble.sh     # rc=2, ~35 s
  • rubash: ble.sh: line 28570: syntax error near unexpected end of file (rc=2, empty stdout).
  • GNU 5.3.0 (WSL /usr/local/bin/bash): bash -n rc=0, instant.

Site: line 28570 is the fi closing the ble-edit/io msys/fifo setup block; the preceding lines include ble/fd#alloc _ble_edit_io_fd2 '> "$_ble_edit_io_fname2.pipe"' (28562, a single-quoted redirect-looking argument) and two function ble-edit/bind/stdout.off { ... } definitions inside if/elif arms (28563-28568).

Not yet minimized: the divergence is parse-state dependent — extracting lines 28550-28570 wrapped in balancing if true; thens parses rc=0 in BOTH shells, and balanced windows ending at 28570 also pass in both. The error only reproduces with the accumulated file context (the group driver path is required: scripts mentioning expand_aliases take run_script_with_history; a # expand_aliases comment forces it on an extract).

Secondary (perf, same file): full-file -n takes ~35 s vs GNU instant, and --noattach source mode ~13 s vs GNU ~0.2 s (both rc=1, zero output — #245's termination fix holds; the remaining cost is the driver's per-line re-scan of the accumulated group text, O(group²) worst case — largest remaining groups are ~250-330 lines).

Classification: rubash-caused, parse-level. Root cause NOT yet established — needs the owning GNU C function identified (candidate owners: parse.y function_def/if-clause nesting or the quoted-argument word scan) before any edit. Artifacts: target/issue-suites/results/ble-lane/ble/ble-nightly/final-n.err, probes nb1-nb4.sh / nw.sh windows under target/issue-suites/results/ble-lane/.

Activity

  1. added
    bug
    on Sep 27, 2026
  2. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    已修复并合入 master:根因是驱动器在行尾二元连接符后错误闭合命令组——GNU 文法在产生式内消费该换行(parse.y:1286/1471),PS2 续读。这是整个 39k 行 ble.sh 文件的首个行跨 && 形状。修复后 ble.sh -n rc=0 与 GNU 一致(35s);新黄金夹具 andor-continuation 钉住该类。

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