[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

Serhiy Storchaka report at bugs.python.org
Wed Mar 27 13:25:35 EDT 2019


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

Disabling the trashcan mechanism returns the problem for solving which the trashcan mechanism was introduced.

>>> from _testcapi import MyList
>>> L = None
>>> for i in range(1000000):
...     L = MyList((L,))
... 
>>> del L
Segmentation fault (core dumped)

I think we need better way to resolve this issue.

For example, setting the object type to the parent type should solve this issue.

----------

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


More information about the Python-bugs-list mailing list