Fix multithreaded shutdown thread safety issues - #5960
Open
ngoldbaum wants to merge 9 commits into
Open
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 |
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.