GeezerVison is showing github.com — gh-160588: Restore the gh-123022 check in the vendored mimalloc by devdavidejesus · Pull Request #160589 · python/cpython
Conversation
devdavidejesus
commented
Oct 24, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
The mimalloc 2.5.2 update (gh-159111) dropped the CPython-specific check from gh-123022 in Objects/mimalloc/os.c, which skips _mi_heap_random_next() while the thread's default heap is not initialized. It looks like another downstream change lost in the upgrade, like the ones restored in gh-160207. This restores it as it was before the update.
On 3.14 the missing check makes Py_Initialize() in a background thread crash on free-threaded release builds (test_init_in_background_thread fails). On main the test passes even without the check, because the raw domain already initializes the heap; the change is here so that it can be backported to 3.15 and 3.14. If gh-159718 (mimalloc v3) lands first, this is not needed on main and could go to 3.15 and 3.14 directly.
Tested on macOS with free-threaded release builds: with this change the test passes 20 of 20 times on 3.14 (20 of 20 crashes without it), and test_embed passes on main and 3.14.
No NEWS entry: the regression is not in any release yet (3.14.9 still has the check).
See #160588.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…malloc
The mimalloc 2.5.2 update dropped the check that skips
_mi_heap_random_next() while the thread's default heap is not
initialized. Without it, Py_Initialize() in a background thread
crashes on free-threaded release builds of 3.14.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
devdavidejesus reacted with thumbs up emoji
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks @devdavidejesus for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
corona10
corona10 approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|