if (PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) {
// This field *must* be invalidated if the type is modified (see the
// comment on struct _specialization_cache):
- ((PyHeapTypeObject *)type)->_spec_cache.getitem = NULL;
+ FT_ATOMIC_STORE_PTR_RELAXED(
+ ((PyHeapTypeObject *)type)->_spec_cache.getitem, NULL);
}
}
if (PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) {
// This field *must* be invalidated if the type is modified (see the
// comment on struct _specialization_cache):
- ((PyHeapTypeObject *)type)->_spec_cache.getitem = NULL;
+ FT_ATOMIC_STORE_PTR_RELAXED(
+ ((PyHeapTypeObject *)type)->_spec_cache.getitem, NULL);
}
}
# gh-129748: test.test_free_threading.test_slots.TestSlots.test_object
race_top:mi_block_set_nextx
+# gh-127266: type slot updates are not thread-safe (test_opcache.test_load_attr_method_lazy_dict)
+race_top:update_one_slot
+
# https://gist.github.com/mpage/6962e8870606cfc960e159b407a0cb40
thread:pthread_create