Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-143635: Fix crash in_Py_typing_type_repr#143670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
Uh oh!
There was an error while loading.Please reload this page.
JelleZijlstra commentedJan 11, 2026
This needs NEWS since it fixes a user-visible crash. |
JelleZijlstra left a comment
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.
Actually this is incorrect. The crash can be triggered if the list is cleared while we're iterating over it inga_repr_items_list. INCREFing here is insufficient to protect us because the item may not be valid in the first place any more by the time we receive it.
My repro case in#143823 makes this clearer.
When you're done making the requested changes, leave the comment: |
sobolevn commentedJan 14, 2026
Thank you! I refactored the PR to include the fix for the third case. |
picnixz commentedJan 14, 2026
I thought there were more occurrences pf this function but am I wrong? or is it just me on mobile? |
picnixz commentedJan 14, 2026
Or is it just in recursive calls where we already hold enough strong references? |
JelleZijlstra commentedJan 14, 2026
The other calls look safe to me. |
bdba5f0 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
(cherry picked from commitbdba5f0)Co-authored-by: sobolevn <mail@sobolevn.me>
Sorry,@sobolevn, I could not cleanly backport this to |
GH-143851 is a backport of this pull request to the3.14 branch. |
GH-143852 is a backport of this pull request to the3.13 branch. |
)(cherry picked from commitbdba5f0)
bedevere-bot commentedJan 15, 2026
|
Uh oh!
There was an error while loading.Please reload this page.
I also added one more test case for a second possible crash in the same function.
_Py_typing_type_reprvia re-entrant__origin__lookup duringGenericAliasrepr #143635