https://github.com/python/cpython/commit/c99fad72a1c86c0ae4522ef02de2b4811bd7591f
commit: c99fad72a1c86c0ae4522ef02de2b4811bd7591f
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: encukou <[email protected]>
date: 2025-07-20T10:55:40+02:00
summary:

[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 d19bb4471331ca2cb87b86e4c904bc9a2bafb044)

Co-authored-by: Disconnect3d <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>

files:
M Doc/c-api/memory.rst
M Doc/using/configure.rst

diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst
index f7618a025ba3d8..1d0e6c399a5678 100644
--- a/Doc/c-api/memory.rst
+++ b/Doc/c-api/memory.rst
@@ -656,6 +656,10 @@ This allocator is disabled if Python is configured with the
 :option:`--without-pymalloc` option. It can also be disabled at runtime using
 the :envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``).
 
+Typically, it makes sense to disable the pymalloc allocator when building
+Python with AddressSanitizer (:option:`--with-address-sanitizer`) which helps
+uncover low level bugs within the C code.
+
 Customize pymalloc Arena Allocator
 ----------------------------------
 
diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst
index aa2edd5dd7f29d..ba69b68d977279 100644
--- a/Doc/using/configure.rst
+++ b/Doc/using/configure.rst
@@ -771,6 +771,9 @@ Debug options
 .. option:: --with-address-sanitizer
 
    Enable AddressSanitizer memory error detector, ``asan`` (default is no).
+   To improve ASan detection capabilities you may also want to combine this
+   with :option:`--without-pymalloc` to disable the specialized small-object
+   allocator whose allocations are not tracked by ASan.
 
    .. versionadded:: 3.6
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to