[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

STINNER Victor report at bugs.python.org
Tue Sep 3 15:30:29 EDT 2019


STINNER Victor <vstinner at python.org> added the comment:

collect() of gcmodule.c:

* collect() builds an "unreachable" list which is quite important in this bug
* the bug occurs in delete_garbage() which uses the unreachable list
* weak references part of unreachable are handled before delete_garbage() in handle_weakrefs(): "Clear weakrefs and invoke callbacks as necessary".

It seems like reproducer.tar.gz and gc_crash.py crashes involve a reference cycle.

reproducer.tar.gz uses a weak reference which is *not* part of the reference cycle.

----------

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


More information about the Python-bugs-list mailing list