pyfailmalloc: new debug tool to test how your applications handles MemoryError

Hi, The PEP 445 (Add new APIs to customize Python memory allocators) has been accepted, I commited its implementation. So it's time to have fun with this API. I developed a small Python module (150 lines of C code) to inject memory allocation failures: https://pypi.python.org/pypi/pyfailmalloc This module can be used to test your application under very low memory condition, test how your application handles MemoryError. I ran it in the Python test suite: Python core and stdlib do not handle MemoryError correctly everywhere... I opened the following issue to track all bugs found by pytracemalloc and related commits to fix these bugs: http://bugs.python.org/issue18408 I already fixed bugs in PyObject_GC_NewVar(), PyDict_New(), list.pop(), type.__bases__ setter, etc. I also found a bug in _PyMem_DebugRealloc(): a function supposed to detect bugs :-) Have fun with this new tool on your applications and Python modules. Tell me if you would like to help me on issue #18408, there are still a lot of bugs to fix. Victor

2013/7/9 Victor Stinner <victor.stinner@gmail.com>:
Bitbucket was down, so I was unable to give the link to its source code. The server is back, here is the C code: https://bitbucket.org/haypo/pyfailmalloc/src/tip/failmalloc.c You can see that it's now easy to develop such tools thanks to the PEP 445. Victor

2013/7/9 Victor Stinner <victor.stinner@gmail.com>:
Bitbucket was down, so I was unable to give the link to its source code. The server is back, here is the C code: https://bitbucket.org/haypo/pyfailmalloc/src/tip/failmalloc.c You can see that it's now easy to develop such tools thanks to the PEP 445. Victor
participants (1)
-
Victor Stinner