-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-130547: Fix race between dict_dealloc and split_keys_entry_added #130778
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Other access case looks fine because of |
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.
LGTM
Objects/dictobject.c
Outdated
@@ -3254,7 +3254,7 @@ dict_dealloc(PyObject *self) | |||
Py_TRASHCAN_BEGIN(mp, dict_dealloc) | |||
if (values != NULL) { | |||
if (values->embedded == 0) { | |||
for (i = 0, n = mp->ma_keys->dk_nentries; i < n; i++) { | |||
for (i = 0, n = FT_ATOMIC_LOAD_SSIZE_RELAXED(mp->ma_keys->dk_nentries); i < n; i++) { |
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.
We could also do n = values->capacity
, which seems a bit cleaner to me because values->capacity
never changes.
🤖 New build scheduled with the buildbot fleet by @corona10 for commit 41387ae 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F130778%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
!buildbot Refleaks |
🤖 New build scheduled with the buildbot fleet by @corona10 for commit 41387ae 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F130778%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Failures looks flasky. |
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…dded (pythongh-130778) (cherry picked from commit 80e6d3e) Co-authored-by: Donghee Na <[email protected]>
GH-130833 is a backport of this pull request to the 3.13 branch. |
dict_dealloc
andsplit_keys_entry_added
under free threading #130547