Repository navigation
gh-158203: fix crash when static extension type used from subinterpreter - #159095
Open
BHUVANSH855 wants to merge 2 commits into
Open
BHUVANSH855 wants to merge 2 commits into
BHUVANSH855 wants to merge 2 commits into
Conversation
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.
Fix a crash (SIGSEGV) when a static C extension type is used from a subinterpreter after the main interpreter has populated its method cache.
cache_slot()returned&type->_tp_cachefor static non-heap types that lack_Py_TPFLAGS_STATIC_BUILTIN— a globally shared field. When a subinterpreter resized the cache, it freed the main interpreter's copy causing a use-after-free.Fix: return
NULLfromcache_slot()for such types; all callers treatNULLas caching disabled.Fixes gh-158203.