Skip to content

eval-family EOF diagnostics report the function-definition line instead of the invocation line (GNU: call site) #318

Closed

Description

@caomengxuan666

From wt13/fixpack probes 11-14 (master behavior): eval that hits an unexpected-EOF class error inside a function reports the function definition line number; GNU reports the eval call-site line. GNU anchor: the evalstring input name/line tracking (evalstring.c) and error.c diagnostics.

Activity

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

    @caomengxuan666
    MemberAuthor

    Fixed by wt16/fix16 (206dc04) + regression repaired by wt17/snaprec (ea73fc1e, master aaa1d29): the original fix mapped eval EOF diagnostics to GNU three abort classes, but its NeverClosed arm called mark_parse_error() which killed the whole outer script after command eval '( '. The snaprec bisect (cargo-test clean spawn: 1237459 PASS -> 8064c2f PASS -> 206dc04 FAIL) convicted the lane commit; the repair ports the GNU three-layer abort model in full — push_stream/pop_stream clear EOF_Reached per level (parse.y:1908/1915, eval string parse errors never abort the outer reader), the ONLY exit is posix+bare-eval ERREXIT at evalstring.c:584-600, and the command prefix suppresses it via executing_command_builtin (execute_cmd.c:4735, ported as command_builtin_depth). Plus same-family stderr wording: bash-5.3 compoundcmd message (y.tab.c:9258), main-level token errors name the token AFTER ( with no "while looking for matching" suffix (y.tab.c:9208-9215), x=(( names ( itself (parse.y:7141-7152), x=( posix exits 1 unconditionally (parse.y:7173-7179), bare posix eval ERREXIT exits 2. 35/35 probe matrix byte-identical to WSL GNU 5.3.0; errors.snap passes with the committed bytes (zero re-record); 546 lib / 27 regression / 15 issue318 tests green. Residuals recorded in #334: errors8.sub still misses ok5-8 (four separate command-builtin posix abort owners, unchanged by both passes).

  3. added a commit that references this issue on Oct 12, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions