Skip to content

Commit 206788a

Browse files
gh-154502: Disable junk filling in the OpenBSD allocator in test_capi (GH-154503)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6fb51f2 commit 206788a

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')
@@ -102,7 +105,9 @@ def check_pyobject_is_freed(self, func_name):
102105
assert_python_ok(
103106
'-c', code,
104107
PYTHONMALLOC=self.PYTHONMALLOC,
108+
# See the comment in check() above.
105109
MALLOC_CONF="junk:false",
110+
MALLOC_OPTIONS="j",
106111
)
107112

108113
def test_pyobject_null_is_freed(self):

0 commit comments

Comments
 (0)