Closed
Description
Bug report
Bug description:
class C: pass
f = C()
# Reader code:
f.foo
# Writer code:
f.__dict__ = {}
When there's a thread reading from an object and another thread replacing the dictionary we can crash. This is because the read has a borrowed reference to the dictionary which gets simultaneously decref'd when the writer replaces it.
Expected behavior: No crashes
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux