Skip to content

Raise instead of silent success: closed-channel send, missing load_file path, missing expression (#505, #490, #494)#518

Merged
InauguralPhysicist merged 1 commit into
mainfrom
fix/490-494-505-silent-tolerance
Jul 9, 2026
Merged

Raise instead of silent success: closed-channel send, missing load_file path, missing expression (#505, #490, #494)#518
InauguralPhysicist merged 1 commit into
mainfrom
fix/490-494-505-silent-tolerance

Conversation

@InauguralPhysicist

Copy link
Copy Markdown
Collaborator

Silent-tolerance audit batch-2d. Three paths that returned a silent wrong value with rc=0 now raise a catchable error from the closed error-kind set. Each was reproduced first, fixed, and given a regression test.

Fixes

  • send: closed channel silently drops value (no error) #505send to a closed channel silently dropped the value. A producer that raced a consumer's close_channel lost messages with no signal. Now raises a catchable value error. Lock discipline: the enqueue path unlocks before returning; the closed path unlocks → val_decrefrt_error (never calls rt_error while holding the channel mutex). recv on a closed empty channel still returns null (EOF-like — intended).
  • load_file: missing path returns null without raising (silent success) #490load_file of a missing/unreadable path returned a silent null (stderr warn + rc=0). Now raises a catchable io error, matching import's severity and the function's own parse/compile failure paths.
  • parser: missing expression after is/of silently becomes null (x is, print of, throw of) #494 — parser folded a missing expression into a silent null. x is, print of, throw of, eval of "x is " bound/emitted null and continued with rc=0. parse_primary now raises Parse error line N: expected expression on a statement terminator (catchable parse via eval/import/load_file). Bare return — the one legitimate empty-expression position — checks the terminator itself and still yields null.

Tests

  • test_raise_on_bad_input.eigs [116]: batch-2d cases + eval-catchable parse (count 43→48).
  • New examples/errors/missing_expression.eigs [90] (direct-source rc=1).
  • Docs: BUILTINS.md (send/load_file rows), CHANGELOG.md.

Validation

  • Release suite: 2683/2683, 0 failed.
  • ASan+UBSan with detect_leaks=1: 2683/2683, 0 failed, leak tally clean.

Closes #505
Closes #490
Closes #494

🤖 Generated with Claude Code

…ng load_file path, and missing expression (#505, #490, #494)

Silent-tolerance audit batch-2d. Three paths that returned a silent
wrong value with rc=0 now raise a catchable error:

- send to a closed channel raised nothing and dropped the value (a
  producer racing a consumer's close lost messages). Now raises a
  catchable `value` error; the enqueue path unlocks before returning and
  the closed path unlocks -> decref -> rt_error (never rt_error under the
  channel mutex). recv on a closed empty channel still returns null. (#505)

- load_file of a missing/unreadable path printed to stderr and returned a
  silent null; now raises a catchable `io` error, matching import's
  severity and the function's own parse/compile failure paths. (#490)

- the parser folded a missing expression after is/of/unary or as a
  throw/print argument (x is, print of, throw of, eval of "x is ") into a
  silent null and continued. parse_primary now raises "expected
  expression" on a statement terminator; bare `return` (the one
  legitimate empty-expression position) checks the terminator itself and
  still yields null. (#494)

Tests: batch-2d cases + eval-catchable parse in test_raise_on_bad_input
([116], count 43->48), new examples/errors/missing_expression.eigs ([90]).
Docs: BUILTINS.md (send/load_file), CHANGELOG. Release + ASan/leak suites
2683/2683, leak-clean.

Closes #505
Closes #490
Closes #494

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@InauguralPhysicist InauguralPhysicist merged commit 72b2060 into main Jul 9, 2026
17 checks passed
@InauguralPhysicist InauguralPhysicist deleted the fix/490-494-505-silent-tolerance branch July 9, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant