Skip to content

Commit 34f948a

Browse files
serhiy-storchakaclaude
authored andcommitted
gh-154502: Disable junk filling in the OpenBSD allocator in test_capi (GH-154503)
(cherry picked from commit 206788a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b51729a commit 34f948a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Lib/test/test_capi/test_mem.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ def check(self, code):
2424
out = assert_python_failure(
2525
'-c', code,
2626
PYTHONMALLOC=self.PYTHONMALLOC,
27-
# FreeBSD: instruct jemalloc to not fill freed() memory
28-
# with junk byte 0x5a, see JEMALLOC(3)
27+
# Instruct the system allocator to not fill freed() memory
28+
# with junk bytes:
29+
# FreeBSD: jemalloc, see JEMALLOC(3).
2930
MALLOC_CONF="junk:false",
31+
# OpenBSD: see MALLOC.CONF(5).
32+
MALLOC_OPTIONS="j",
3033
)
3134
stderr = out.err
3235
return stderr.decode('ascii', 'replace')
@@ -97,7 +100,9 @@ def check_pyobject_is_freed(self, func_name):
97100
assert_python_ok(
98101
'-c', code,
99102
PYTHONMALLOC=self.PYTHONMALLOC,
103+
# See the comment in check() above.
100104
MALLOC_CONF="junk:false",
105+
MALLOC_OPTIONS="j",
101106
)
102107

103108
def test_pyobject_null_is_freed(self):

0 commit comments

Comments
 (0)