gh-152235: Defer GC tracking of set and frozenset to end of construction#152237
Conversation
TSAN scriptAS-ISTO-BE |
| so = (PySetObject *)type->tp_alloc(type, 0); | ||
| // Allocate untracked: the fill below runs user code, and a half-built | ||
| // set must not be reachable from another thread via gc.get_objects(). | ||
| so = (PySetObject *)_PyType_AllocNoTrack(type, 0); |
There was a problem hiding this comment.
Should we update the type spec and remove PyType_GenericAlloc from tp_alloc?
|
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-152242 is a backport of this pull request to the 3.15 branch. |
|
Sorry, @corona10, I could not cleanly backport this to |
|
GH-152243 is a backport of this pull request to the 3.14 branch. |
|
I'm not sure that it's correct to change A custom set subclass calling directly Well, I'm not sure. It's kind of uncommon to call |
|
Objects/tupleobject.c has been modified to only track the tuple once it's fully initialization. Well, it's more complicated, it's only tracked if one of its items is tracked :-) Objects/dictobject.c calls Oh, and I'm the one who changed Ok, maybe it's ok to change |
|
GH-152272 is a backport of this pull request to the 3.13 branch. |
…terable.