diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-10-25 15:31:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 15:31:10 (GMT) |
commit | 626bff856840f471e98ec627043f780c111a063d (patch) | |
tree | 4c8f4da76f3443157e7a06a96d88bbc631650f88 /Makefile.pre.in | |
parent | 18618e652c56e61a134e596b315a13c7cb997a89 (diff) | |
download | cpython-626bff856840f471e98ec627043f780c111a063d.zip cpython-626bff856840f471e98ec627043f780c111a063d.tar.gz cpython-626bff856840f471e98ec627043f780c111a063d.tar.bz2 |
bpo-9263: Dump Python object on GC assertion failure (GH-10062)
Changes:
* Add _PyObject_AssertFailed() function.
* Add _PyObject_ASSERT() and _PyObject_ASSERT_WITH_MSG() macros.
* gc_decref(): replace assert() with _PyObject_ASSERT_WITH_MSG() to
dump the faulty object if the assertion fails.
_PyObject_AssertFailed() calls:
* _PyMem_DumpTraceback(): try to log the traceback where the object
memory has been allocated if tracemalloc is enabled.
* _PyObject_Dump(): log repr(obj).
* Py_FatalError(): log the current Python traceback.
_PyObject_AssertFailed() uses _PyObject_IsFreed() heuristic to check
if the object memory has been freed by a debug hook on Python memory
allocators.
Initial patch written by David Malcolm.
Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'Makefile.pre.in')
0 files changed, 0 insertions, 0 deletions