Skip to content

Commit c99fad7

Browse files
miss-islingtondisconnect3dencukou
authored
[3.13] Doc/c-api/memory.rst: extend --without-pymalloc doc with ASan information (GH-136790) (#136799)
Extends the documentation for disabling pymalloc with the `--without-pymalloc` flag regarding why it is worth to use it when enabling AddressSanitizer for Python build (which is done, e.g., in CPython's CI builds). (cherry picked from commit d19bb44) Co-authored-by: Disconnect3d <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
1 parent f7be0ee commit c99fad7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Doc/c-api/memory.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,10 @@ This allocator is disabled if Python is configured with the
656656
:option:`--without-pymalloc` option. It can also be disabled at runtime using
657657
the :envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``).
658658
659+
Typically, it makes sense to disable the pymalloc allocator when building
660+
Python with AddressSanitizer (:option:`--with-address-sanitizer`) which helps
661+
uncover low level bugs within the C code.
662+
659663
Customize pymalloc Arena Allocator
660664
----------------------------------
661665

Doc/using/configure.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,9 @@ Debug options
771771
.. option:: --with-address-sanitizer
772772

773773
Enable AddressSanitizer memory error detector, ``asan`` (default is no).
774+
To improve ASan detection capabilities you may also want to combine this
775+
with :option:`--without-pymalloc` to disable the specialized small-object
776+
allocator whose allocations are not tracked by ASan.
774777

775778
.. versionadded:: 3.6
776779

0 commit comments

Comments
 (0)