| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
This looks like a real issue. Comments on PR:
|
Sorry, something went wrong.
|
Hello @nascheme! Thank you for the comments. I have resolved those issues. Let me know if there are any other changes to be made. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR resolves finding 61 from the weakref race tracking issue: "Racy weakref head load before incref in Objects/typeobject.c".
Description
In free-threaded builds, subtype_getweakref() had a race condition where the weakref list head (*weaklistptr) was loaded and immediately passed to Py_NewRef(). If another thread concurrently triggered weakref_dealloc(), the weakref could be freed before the incref, leading to a use-after-free (UAF).
This PR fixes the issue by:
Testing
Added regression tests in Lib/test/test_free_threading/test_weakref.py that:
AI Tool Disclosure:
Claude Code was used to help understand the relevant code paths and to improve the clarity and documentation of the proposed tests. It was not used to modify Objects/typeobject.c; all code changes and final decisions were made by me.