gh-152238: Revert gh-150490 and gh-152200. (gh-152232)

Revert commits:
    gh-151593: Fix dead lock in PyDict insert_split_key() (#152200)
    gh-150490: Raise PyType_Modified for insertion into split dictionary (#150489)

For gh-150489, it violates locking discipline and results in deadlocks,
gh-151593 is an example of it being hit in CI.  The attempted fix 
gh-152200 avoids the deadlock but introduces a data-race.  The race
window is small but can be triggered with pure Python code.
This commit is contained in:
Neil Schemenauer 2026-06-26 11:20:41 -07:00 committed by GitHub
parent 5a549e82b8
commit 9626ef87f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 1412 additions and 1308 deletions

View file

@ -4270,6 +4270,13 @@ dummy_func(
EXIT_IF(!FT_ATOMIC_LOAD_UINT8(ivs->valid));
}
op(_GUARD_KEYS_VERSION, (keys_version/2, owner -- owner)) {
PyTypeObject *owner_cls = Py_TYPE(PyStackRef_AsPyObjectBorrow(owner));
PyHeapTypeObject *owner_heap_type = (PyHeapTypeObject *)owner_cls;
PyDictKeysObject *keys = owner_heap_type->ht_cached_keys;
EXIT_IF(FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != keys_version);
}
op(_LOAD_ATTR_METHOD_WITH_VALUES, (descr/4, owner -- attr, self)) {
assert(oparg & 1);
/* Cached method object */
@ -4286,7 +4293,7 @@ dummy_func(
_RECORD_TOS_TYPE +
_GUARD_TYPE_VERSION +
_GUARD_DORV_VALUES_INST_ATTR_FROM_DICT +
unused/2 +
_GUARD_KEYS_VERSION +
_LOAD_ATTR_METHOD_WITH_VALUES;
op(_LOAD_ATTR_METHOD_NO_DICT, (descr/4, owner -- attr, self)) {
@ -4320,7 +4327,7 @@ dummy_func(
_RECORD_TOS_TYPE +
_GUARD_TYPE_VERSION +
_GUARD_DORV_VALUES_INST_ATTR_FROM_DICT +
unused/2 +
_GUARD_KEYS_VERSION +
_LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES;
op(_LOAD_ATTR_NONDESCRIPTOR_NO_DICT, (descr/4, owner -- attr)) {