bpo-38392: PyObject_GC_Track() validates object in debug mode by vstinner · Pull Request #16615 · python/cpython

serhiy-storchaka

@vstinner

In debug mode, PyObject_GC_Track() now calls tp_traverse() of the
object type to ensure that the object is valid: test that objects
visited by tp_traverse() are valid.

Fix pyexpat.c: only track the parser in the GC once the parser is
fully initialized.

@vstinner vstinner changed the title [WIP] bpo-38392: PyObject_GC_Track() validates object in debug mode bpo-38392: PyObject_GC_Track() validates object in debug mode

Oct 7, 2019

@vstinner

Onyly track the object in the GC once it's fully initialized.

jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request

Dec 5, 2019
…GH-16615)

In debug mode, PyObject_GC_Track() now calls tp_traverse() of the
object type to ensure that the object is valid: test that objects
visited by tp_traverse() are valid.

Fix pyexpat.c: only track the parser in the GC once the parser is
fully initialized.