This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients gregory.p.smith, neologix, python-dev, serhiy.storchaka, vstinner
Date 2013-07-17.10:24:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
2013/7/17 Charles-François Natali <>:
> Victor, how about adding pyfailmalloc to the main repo (maybe under Tools), with a script making it easy to run the tests suite with it enabled?
> This way, it'll make it easier to run it from time to time (one could eve imagine making it part of the test suite at some point, but that's another story...).

I plan to write a new module and propose it for inclusion in Python
3.4. It will have the features of pytracemalloc *and* pyfailmalloc,
and also statistics (number of calls to each allocator function, with
a function to reset counters).

The blocker pointer is to get the size of a buffer on free(). In
pytracemalloc, I'm using a glib hash lib: pointer => structure {size
of the buffer, filename, line number}. The dependency to glib should
be removed to integrate the module in Python :-)

The simpler solution is to allocate a wider buffer and store the
metadata directly in the buffer before the data. The second problem is
how this feature would be enabled. Enabling the feature at runtime
would require a new environment variable to set the right memory
allocator at startup. The choice of the memory allocator must be done
before the first memory allocation, so in main().

Integrating pytracemalloc into CPython was my main motivation to write
the PEP 445.

If you would like to use pyfailmalloc right now, you have to:

* build pyfailmalloc with Python 3.4
* apply debug_cpython.patch on Python which is the pyfailmalloc repository
* run gdb -x debug_cpython.gdb (which can also be found in the
pyfailmalloc repository)
Date User Action Args
2013-07-17 10:24:11vstinnersetrecipients: + vstinner, gregory.p.smith, neologix, python-dev, serhiy.storchaka
2013-07-17 10:24:11vstinnerlinkissue18408 messages
2013-07-17 10:24:11vstinnercreate