[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

Serhiy Storchaka report at bugs.python.org
Tue Apr 7 13:48:08 EDT 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Recently many static allocated types were converted to heap allocated types (using PyType_FromSpec). Now you need to add Py_VISIT(Py_TYPE(self)) in all corresponding tp_visit implementations.

And since even official example for heap allocated types do not contain it (and it was not needed before 3.9), I am sure that all existing code do not contain it.

We cannot change all user code, so we should change the interpreter code so that it will work correctly with existing user code.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40217>
_______________________________________


More information about the Python-bugs-list mailing list