]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] bpo-46263: FreeBSD 14.0 jemalloc workaround for junk bytes of freed memory...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 6 Jan 2022 15:52:21 +0000 (07:52 -0800)
committerGitHub <noreply@github.com>
Thu, 6 Jan 2022 15:52:21 +0000 (16:52 +0100)
Co-authored-by: Christian Heimes <christian@python.org>
Lib/test/test_capi.py
Misc/NEWS.d/next/Tests/2022-01-06-15-45-34.bpo-46263.bJXek6.rst [new file with mode: 0644]

index 87f327414b54ed6aea6c1aee9558e16424a1a435..72c648f54d8b70a032220d65fbd4a5832df2e79f 100644 (file)
@@ -763,8 +763,13 @@ class PyMemDebugTests(unittest.TestCase):
 
     def check(self, code):
         with support.SuppressCrashReport():
-            out = assert_python_failure('-c', code,
-                                        PYTHONMALLOC=self.PYTHONMALLOC)
+            out = assert_python_failure(
+                '-c', code,
+                PYTHONMALLOC=self.PYTHONMALLOC,
+                # FreeBSD: instruct jemalloc to not fill freed() memory
+                # with junk byte 0x5a, see JEMALLOC(3)
+                MALLOC_CONF="junk:false",
+            )
         stderr = out.err
         return stderr.decode('ascii', 'replace')
 
diff --git a/Misc/NEWS.d/next/Tests/2022-01-06-15-45-34.bpo-46263.bJXek6.rst b/Misc/NEWS.d/next/Tests/2022-01-06-15-45-34.bpo-46263.bJXek6.rst
new file mode 100644 (file)
index 0000000..0334af4
--- /dev/null
@@ -0,0 +1,2 @@
+Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill freed memory
+with junk byte.