Repository navigation
Fix multithreaded shutdown thread safety issues - #5960
Merged
Merged
Conversation
ngoldbaum
force-pushed
the
shutdown-release-race
branch
2 times, most recently
from
August 5, 2026 00:14
f8ff54e to
6d48fdb
Compare
ngoldbaum
force-pushed
the
shutdown-release-race
branch
from
August 5, 2026 01:17
6d48fdb to
6e5c525
Compare
ngoldbaum
marked this pull request as ready for review
August 5, 2026 14:41
Collaborator
|
Jenkins error (on zarch) is |
ViralBShah
added a commit
to JuliaLang/julia
that referenced
this pull request
Oct 26, 2026
…#64249) * openblas: Carry upstream fix for allocator contention between threads OpenBLAS's default (non-TLS) buffer allocator, which Julia uses, serializes threads that call BLAS concurrently. Small level-2 calls such as `trsv` from several threads then run slower than the same calls made one after another, and so do parallel solves with one supernodal CHOLMOD factor, which make many such calls. Carry the five commits of OpenMathLib/OpenBLAS#6105, which remove that contention and fix a crash once more buffers are in use than the main table holds, until a release includes them. The commits apply after the winexit and cancellation patches. The only change from upstream: the overflow area's release table keeps 0.3.34's `malloc`, since upstream's `calloc` goes with shutdown bookkeeping from OpenMathLib/OpenBLAS#5960 that 0.3.34 lacks. This covers the source build. The binaries get the same patch through JuliaPackaging/Yggdrasil#15321 and a new `OpenBLAS_jll`. Assisted-by: Claude Code (Opus 5.5) * openblas: Update OpenBLAS_jll to 0.3.34+1 Use the build of OpenBLAS 0.3.34 that carries the allocator contention fix from the previous commit, so that the binaries get it too. Assisted-by: Claude Code (Opus 5.5)
KristofferC
pushed a commit
to JuliaLang/julia
that referenced
this pull request
Oct 28, 2026
…#64249) * openblas: Carry upstream fix for allocator contention between threads OpenBLAS's default (non-TLS) buffer allocator, which Julia uses, serializes threads that call BLAS concurrently. Small level-2 calls such as `trsv` from several threads then run slower than the same calls made one after another, and so do parallel solves with one supernodal CHOLMOD factor, which make many such calls. Carry the five commits of OpenMathLib/OpenBLAS#6105, which remove that contention and fix a crash once more buffers are in use than the main table holds, until a release includes them. The commits apply after the winexit and cancellation patches. The only change from upstream: the overflow area's release table keeps 0.3.34's `malloc`, since upstream's `calloc` goes with shutdown bookkeeping from OpenMathLib/OpenBLAS#5960 that 0.3.34 lacks. This covers the source build. The binaries get the same patch through JuliaPackaging/Yggdrasil#15321 and a new `OpenBLAS_jll`. Assisted-by: Claude Code (Opus 5.5) * openblas: Update OpenBLAS_jll to 0.3.34+1 Use the build of OpenBLAS 0.3.34 that carries the allocator contention fix from the previous commit, so that the binaries get it too. Assisted-by: Claude Code (Opus 5.5) (cherry picked from commit 3e610d6)
KristofferC
pushed a commit
to JuliaLang/julia
that referenced
this pull request
Oct 28, 2026
…#64249) * openblas: Carry upstream fix for allocator contention between threads OpenBLAS's default (non-TLS) buffer allocator, which Julia uses, serializes threads that call BLAS concurrently. Small level-2 calls such as `trsv` from several threads then run slower than the same calls made one after another, and so do parallel solves with one supernodal CHOLMOD factor, which make many such calls. Carry the five commits of OpenMathLib/OpenBLAS#6105, which remove that contention and fix a crash once more buffers are in use than the main table holds, until a release includes them. The commits apply after the winexit and cancellation patches. The only change from upstream: the overflow area's release table keeps 0.3.34's `malloc`, since upstream's `calloc` goes with shutdown bookkeeping from OpenMathLib/OpenBLAS#5960 that 0.3.34 lacks. This covers the source build. The binaries get the same patch through JuliaPackaging/Yggdrasil#15321 and a new `OpenBLAS_jll`. Assisted-by: Claude Code (Opus 5.5) * openblas: Update OpenBLAS_jll to 0.3.34+1 Use the build of OpenBLAS 0.3.34 that carries the allocator contention fix from the previous commit, so that the binaries get it too. Assisted-by: Claude Code (Opus 5.5) (cherry picked from commit 3e610d6)
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.
Fixes #5954.
The first commit adds a failing test that stress-tests multithreaded shutdown.
The later commits fixes the bug by adding the missing locking that only
alloc_mmapcurrently has to a centralized helper shared by all the allocator backends and adds locking for the windows allocator case.To fully fix this I also needed to add some more shutdown logic that is needed to prevent the cleanup logic (which acquires locks) from firing if shutdown is in progress. It uses
RtlDllShutdownInProgressfor this, there's also an explanatory comment.