Repository navigation
Conversation
mpage
requested changes
Oct 21, 2026
| FT_ATOMIC_STORE_PTR_RELEASE(oldvalues->values[i], NULL); | ||
| Py_XDECREF(tmp); | ||
| } | ||
| set_values(mp, NULL); |
Contributor
There was a problem hiding this comment.
I think we can observe an inconsistent state here (non-NULL values but keys are Py_EMPTY_KEYS) if Py_XDECREF(tmp) invokes a finalizer.
Contributor
Author
There was a problem hiding this comment.
You're right, and it's actually not necessary here, I was jut being over-zealous. This is actually the non-embedded case so the values don't live in the object, but in the embedded case we're just zeroing out the values, and so the racing thread will take the lock.
|
When you're done making the requested changes, leave the comment: |
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.
When we have an object with a materialized dictionary that's being deleted we have a race condition with converting the dict to no longer use the inline values. While we lock the dict during the conversion we don't lock the dict when we're freeing the object. This can lead to us freeing the object while the dict is trying to read them into the new non-inline values.
We already update
ma_valueswith a release write but we're nulling it out before we've moved the values over. This modifies it so that we are now nulling it out after we've moved the values out. And then we update the object clearing to do an acquire read of the values.