Skip to content

fix SIGSEGV on missing method dispatch (issue 9389)#9394

Open
imclerran wants to merge 1 commit intoroc-lang:mainfrom
imclerran:fix-sigsegv-on-missing-method-9389
Open

fix SIGSEGV on missing method dispatch (issue 9389)#9394
imclerran wants to merge 1 commit intoroc-lang:mainfrom
imclerran:fix-sigsegv-on-missing-method-9389

Conversation

@imclerran
Copy link
Copy Markdown
Collaborator

Fix for issue #9389.

roc test rendered compilation diagnostics and then proceeded into monomorphization regardless. When the type-checker reported MISSING METHOD or UNDEFINED VARIABLE, the dispatch resolver hit an unreachable in release (SIGSEGV) or std.debug.panic in debug. The has_compilation_errors flag was being computed but only consulted at the end for cache outcome.

Bail in rocTest after rendering reports if any are fatal/runtime_error, matching roc check's behavior.

Also fix test/cli/issue8699.roc, which was missing main! and had been relying on the prior overlenient behavior to run tests despite the compile error. Added main! = |_| {} so the fixture compiles cleanly; the test's intent (verify nested-list operations don't panic) is unchanged.

Add CLI integration test roc test does not panic on missing method plus fixture test/cli/MissingMethodDoesNotPanic.roc to prevent regression.

`roc test` rendered compilation diagnostics and then proceeded into
monomorphization regardless. When the type-checker reported MISSING
METHOD or UNDEFINED VARIABLE, the dispatch resolver hit an `unreachable`
in release (SIGSEGV) or `std.debug.panic` in debug. The `has_compilation_errors`
flag was being computed but only consulted at the end for cache outcome.

Bail in `rocTest` after rendering reports if any are fatal/runtime_error,
matching `roc check`'s behavior.

Also fix `test/cli/issue8699.roc`, which was missing `main!` and had been
relying on the prior overlenient behavior to run tests despite the compile
error. Added `main! = |_| {}` so the fixture compiles cleanly; the test's
intent (verify nested-list operations don't panic) is unchanged.

Add CLI integration test `roc test does not panic on missing method` plus
fixture `test/cli/MissingMethodDoesNotPanic.roc` to prevent regression.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@imclerran imclerran force-pushed the fix-sigsegv-on-missing-method-9389 branch from fedaed3 to f298327 Compare May 7, 2026 18:06
@imclerran imclerran linked an issue May 7, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGSEGV when calling a non-existent method

1 participant