gh-117657: Enable test_opcache under TSAN (GH-129831)

Fix a few thread-safety bugs to enable test_opcache when run with TSAN:

 * Use relaxed atomics when clearing `ht->_spec_cache.getitem`
   (gh-115999)
 * Add temporary suppression for type slot modifications (gh-127266)
 * Use atomic load when reading `*dictptr`
This commit is contained in:
Sam Gross 2025-02-11 16:53:08 -05:00 committed by GitHub
parent ed816f1a70
commit f151d27159
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 3 deletions

View file

@ -1612,7 +1612,7 @@ _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method)
else {
PyObject **dictptr = _PyObject_ComputedDictPointer(obj);
if (dictptr != NULL) {
dict = *dictptr;
dict = FT_ATOMIC_LOAD_PTR_ACQUIRE(*dictptr);
}
else {
dict = NULL;