Conversation
This was referenced Sep 25, 2026
maleadt
added this pull request to stack #29
September 25, 2026 13:30
maleadt
marked this pull request as ready for review
September 25, 2026 15:11
`fence(unordered)` raised its error by calling `Core.Intrinsics.atomic_fence(:unordered)`, which throws a ConcurrencyViolationError. Julia's inference however assumes the intrinsic throws an ErrorException, and Julia 1.11 compiles `catch` blocks around it accordingly: the caught error is rebuilt as an ErrorException, and code specialized on that assumption, like a failing `@test_throws`, corrupts memory. This crashed the test suite on 1.11 intermittently. Throw the ConcurrencyViolationError directly instead, on every Julia version, so that inference sees the actual exception.
maleadt
force-pushed
the
tb/fence-unordered
branch
from
September 25, 2026 15:12
2b6d8c8 to
9e3a6ef
Compare
fence(unordered) is caught
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.
Stack: bottom of the stack; #25 builds on this.
fence(unordered)should throw aConcurrencyViolationError. It did so by callingCore.Intrinsics.atomic_fence(:unordered), but Julia's inference assumes that intrinsic throws anErrorException. Julia 1.11 trusts that assumption incatchblocks and treats the caught error as the wrong type, so catching it (e.g. with@test_throws) can corrupt memory. This caused the intermittent segfaults and GC crashes in our test suite on 1.11, present since 0.3.2.This PR throws the error directly instead. Nothing else changes. The underlying Julia bug is JuliaLang/julia#63357, with a fix in JuliaLang/julia#63360.