A failing assert in a Linux JIT run is reported, not a compiler crash - #396
Merged
Merged
Conversation
Off Windows the lowered assert calls glibc's __assert_fail, which ends in abort(). tslang's crash handler took that SIGABRT for a compiler crash and printed "PLEASE submit a bug report" and a "Stack dump" after the message. The JIT now binds __assert_fail to the handler that already answers _assert on Windows: it prints "file:line: assertion failed: msg" and exits with 3. The failing-assert JIT test runs on Linux too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Off Windows, a failing
assertlowers to glibc's__assert_fail, which ends inabort(). Under--emit=jitthat SIGABRT is raised inside tslang, so its crash handler took it for a compiler crash: after the message it printed "PLEASE submit a bug report" and a "Stack dump", and exited with 134.The JIT now binds
__assert_failto the handler that already answers_asserton Windows (jitAssertFailed). It flushes stdout, prints[file:line: ]assertion failed: <msg>, and exits with 3, the same as on Windows:test-jit-assert-message-failing(added Windows-only in #393 because of this crash) now runs on every platform.Tests: Linux (WSL) 3046/3046. Windows: tslang rebuilt,
ctest -R assert13/13. The only Windows change is the CMakeif (WIN32)removal; the jit.cpp change is under#ifndef _WIN32.🤖 Generated with Claude Code