bpo-18859: Document --with-valgrind option in README.valgrind (#10591)

This commit is contained in:
Sanyam Khurana 2018-11-20 16:40:49 +05:30 committed by Łukasz Langa
parent 8b9c33ea9c
commit d5d33681c1
1 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,10 @@ This document describes some caveats about the use of Valgrind with
Python. Valgrind is used periodically by Python developers to try Python. Valgrind is used periodically by Python developers to try
to ensure there are no memory leaks or invalid memory reads/writes. to ensure there are no memory leaks or invalid memory reads/writes.
If you want to enable valgrind support in Python, you will need to
configure Python --with-valgrind option or an older option
--without-pymalloc.
UPDATE: Python 3.6 now supports PYTHONMALLOC=malloc environment variable which UPDATE: Python 3.6 now supports PYTHONMALLOC=malloc environment variable which
can be used to force the usage of the malloc() allocator of the C library. can be used to force the usage of the malloc() allocator of the C library.
@ -46,6 +50,10 @@ If you disable PyMalloc, most of the information in this document and
the supplied suppressions file will not be useful. As discussed above, the supplied suppressions file will not be useful. As discussed above,
disabling PyMalloc can catch more problems. disabling PyMalloc can catch more problems.
PyMalloc uses 256KB chunks of memory, so it can't detect anything
wrong within these blocks. For that reason, compiling Python
--without-pymalloc usually increases the usefulness of other tools.
If you use valgrind on a default build of Python, you will see If you use valgrind on a default build of Python, you will see
many errors like: many errors like: