]> granicus.if.org Git - python/commit
bpo-9263: _PyObject_Dump() detects freed memory (GH-10061)
authorVictor Stinner <vstinner@redhat.com>
Tue, 23 Oct 2018 15:39:40 +0000 (17:39 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Oct 2018 15:39:40 +0000 (17:39 +0200)
commit82af0b63b07aa8d92b50098e382b458143cfc677
tree77c2d497083f78ad622f75ffeb9680c6583d3317
parent96f2c739542d48edd6bd15c26b555c7e59d14cce
bpo-9263: _PyObject_Dump() detects freed memory (GH-10061)

_PyObject_Dump() now uses an heuristic to check if the object memory
has been freed: log "<freed object>" in that case.

The heuristic rely on the debug hooks on Python memory allocators
which fills the memory with DEADBYTE (0xDB) when memory is
deallocated. Use PYTHONMALLOC=debug to always enable these debug
hooks.
Include/object.h
Include/pymem.h
Objects/object.c
Objects/obmalloc.c