From: Victor Stinner Date: Mon, 2 Jun 2014 19:36:59 +0000 (+0200) Subject: Issue #21639: Add a test to check that PyMem_Malloc(0) with tracemalloc enabled X-Git-Tag: v3.4.2rc1~457 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8dd49fe09fc4ac3b527914a0703c0dc0429aa125;p=thirdparty%2FPython%2Fcpython.git Issue #21639: Add a test to check that PyMem_Malloc(0) with tracemalloc enabled does not crash. --- diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py index c953885fc59c..33b0dc2b0ead 100644 --- a/Lib/test/test_tracemalloc.py +++ b/Lib/test/test_tracemalloc.py @@ -807,6 +807,12 @@ class TestCommandLine(unittest.TestCase): b'number of frames', stderr) + def test_pymem_alloc0(self): + # Issue #21639: Check that PyMem_Malloc(0) with tracemalloc enabled + # does not crash. + code = 'import _testcapi; _testcapi.test_pymem_alloc0(); 1' + assert_python_ok('-X', 'tracemalloc', '-c', code) + def test_main(): support.run_unittest(