Skip to content

Commit b259015

Browse files
[3.9] bpo-46263: FreeBSD 14.0 jemalloc workaround for junk bytes of freed memory (GH-30434) (GH-30437)
Co-authored-by: Christian Heimes <christian@python.org>
1 parent cb06831 commit b259015

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

Lib/test/test_capi.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,13 @@ class PyMemDebugTests(unittest.TestCase):
763763

764764
def check(self, code):
765765
with support.SuppressCrashReport():
766-
out = assert_python_failure('-c', code,
767-
PYTHONMALLOC=self.PYTHONMALLOC)
766+
out = assert_python_failure(
767+
'-c', code,
768+
PYTHONMALLOC=self.PYTHONMALLOC,
769+
# FreeBSD: instruct jemalloc to not fill freed() memory
770+
# with junk byte 0x5a, see JEMALLOC(3)
771+
MALLOC_CONF="junk:false",
772+
)
768773
stderr = out.err
769774
return stderr.decode('ascii', 'replace')
770775

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill freed memory
2+
with junk byte.

0 commit comments

Comments
 (0)