]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154502: Disable junk filling in the OpenBSD allocator in test_capi (GH-154503) main
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 22 Jul 2026 22:58:39 +0000 (01:58 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2026 22:58:39 +0000 (01:58 +0300)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_capi/test_mem.py

index 66ab072733e17bd7c78370887d9b67fff6138487..e6389b4e0c1e92457cbea0998ec1db900ee23f65 100644 (file)
@@ -24,9 +24,12 @@ class PyMemDebugTests(unittest.TestCase):
             out = assert_python_failure(
                 '-c', code,
                 PYTHONMALLOC=self.PYTHONMALLOC,
-                # FreeBSD: instruct jemalloc to not fill freed() memory
-                # with junk byte 0x5a, see JEMALLOC(3)
+                # Instruct the system allocator to not fill freed() memory
+                # with junk bytes:
+                # FreeBSD: jemalloc, see JEMALLOC(3).
                 MALLOC_CONF="junk:false",
+                # OpenBSD: see MALLOC.CONF(5).
+                MALLOC_OPTIONS="j",
             )
         stderr = out.err
         return stderr.decode('ascii', 'replace')
@@ -102,7 +105,9 @@ class PyMemDebugTests(unittest.TestCase):
         assert_python_ok(
             '-c', code,
             PYTHONMALLOC=self.PYTHONMALLOC,
+            # See the comment in check() above.
             MALLOC_CONF="junk:false",
+            MALLOC_OPTIONS="j",
         )
 
     def test_pyobject_null_is_freed(self):