mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
81159fce36
commit
9bc19643ed
1 changed files with 2 additions and 0 deletions
|
@ -1103,6 +1103,8 @@ class TestCAPI(unittest.TestCase):
|
|||
|
||||
@unittest.skipIf(_testcapi is None, 'need _testcapi')
|
||||
@threading_helper.requires_working_threading()
|
||||
# gh-128679: Test crash on a debug build (especially on FreeBSD).
|
||||
@unittest.skipIf(support.Py_DEBUG, 'need release build')
|
||||
def test_tracemalloc_track_race(self):
|
||||
# gh-128679: Test fix for tracemalloc.stop() race condition
|
||||
_testcapi.tracemalloc_track_race()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue