cpython
cpython copied to clipboard
GH-99205: Mark new interpreters and threads as non-static
- Issue: gh-99205
Thanks for fixing this, BTW.
@pablogsal, leak tests didn't catch this because we use the "raw" domain to allocate PyThreadState and PyInterpreterState.
Oh interesting, can you confirm that changing the domain to memory makes the test fail?
Oh interesting, can you confirm that changing the domain to memory makes the test fail?
You can't. :)
Fatal Python error: _PyMem_DebugCalloc: Python memory allocator called without holding the GIL
Python runtime state: preinitialized
See this comment:
https://github.com/python/cpython/blob/58ee5d8677fbd4c6c58b7a78117835bccede6bcd/Python/pystate.c#L818-L821
Thanks @brandtbucher for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. 🐍🍒⛏🤖
GH-99301 is a backport of this pull request to the 3.11 branch.