SIGN IN SIGN UP

gh-128679: Skip test_tracemalloc_track_race() on debug build (#128988)

There is a race condition between PyMem_SetAllocator() and
PyMem_RawMalloc()/PyMem_RawFree(). While PyMem_SetAllocator() write
is protected by a lock, PyMem_RawMalloc()/PyMem_RawFree() reads are
not protected by a lock. PyMem_RawMalloc()/PyMem_RawFree() can be
called with an old context and the new function pointer.

On a release build, it's not an issue since the context is not used.
On a debug build, the debug hooks use the context and so can crash.
V
Victor Stinner committed
9bc19643ed54b2aa8558e87fd3a04e8bd1ea7fb2
Parent: 81159fc
Committed by GitHub <noreply@github.com> on 1/18/2025, 3:13:54 PM