GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@devdavidejesus devdavidejesus commented Oct 24, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

  • Issue: Py_Initialize() in a background thread crashes on free-threaded release builds of 3.14 after the mimalloc 2.5.2 update #160588

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@devdavidejesus
pythongh-160588: Restore the pythongh-123022 check in the vendored mi…
a100fe7
…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.
@bedevere-app bedevere-app Bot added the awaiting review label Oct 24, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Oct 24, 2026
Py_Initialize() in a background thread crashes on free-threaded release builds of 3.14 after the mimalloc 2.5.2 update #160588
Closed
@hugovk

hugovk commented Oct 24, 2026

Copy link
Copy Markdown
Member

cc @corona10 @DinoV Does this help #160183 (comment) ?

We may need some security releases soon, so we'll need https://buildbot.python.org/release-status back to green, which may otherwise require a revert of #160183.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

corona10
corona10 approved these changes Oct 24, 2026
View reviewed changes

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

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.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

devdavidejesus reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Oct 24, 2026
@corona10 corona10 added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes skip news labels Oct 24, 2026
@hugovk
hugovk merged commit 34889af into python:main Oct 24, 2026
65 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 24, 2026
@miss-islington-app

miss-islington-app Bot commented Oct 24, 2026

Copy link
Copy Markdown

Thanks @devdavidejesus for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Oct 24, 2026

Copy link
Copy Markdown

GH-160611 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 24, 2026
@bedevere-app

bedevere-app Bot commented Oct 24, 2026

Copy link
Copy Markdown

GH-160612 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 24, 2026
hugovk pushed a commit that referenced this pull request Oct 24, 2026
@miss-islington @devdavidejesus
[3.14] gh-160588: Restore the gh-123022 check in the vendored mimalloc (
8a3454f
GH-160589) (#160612)

Co-authored-by: Davi de Jesus <[email protected]>
hugovk pushed a commit that referenced this pull request Oct 24, 2026
@miss-islington @devdavidejesus
[3.15] gh-160588: Restore the gh-123022 check in the vendored mimalloc (
45fbddd
GH-160589) (#160611)

Co-authored-by: Davi de Jesus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@corona10 corona10 corona10 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

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.

3 participants

@devdavidejesus @hugovk @corona10
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.