From b951dec4418326c06d493020dadedf85a3b29a82 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 6 Jan 2022 07:36:47 -0800 Subject: [PATCH] bpo-46263: FreeBSD 14.0 jemalloc workaround for junk bytes of freed memory (GH-30434) Automerge-Triggered-By: GH:tiran (cherry picked from commit a4aa52dc2801d25b6343fe2ef8de7f40ea3bc883) Co-authored-by: Christian Heimes --- Lib/test/test_capi.py | 9 +++++++-- .../next/Tests/2022-01-06-15-45-34.bpo-46263.bJXek6.rst | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2022-01-06-15-45-34.bpo-46263.bJXek6.rst diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index b5cb3ad0bc0..6453f760a84 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -850,8 +850,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 index 00000000000..0334af4e3cb --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2022-01-06-15-45-34.bpo-46263.bJXek6.rst @@ -0,0 +1,2 @@ +Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill freed memory +with junk byte.