[issue38009] Handle weakreference callbacks invoked indirectly in the middle of a gc collection

Neil Schemenauer report at bugs.python.org
Fri Sep 27 19:01:58 EDT 2019


Neil Schemenauer <nas-python at arctrix.com> added the comment:

I think the problem with your logic is that the weakref to F is part of the garbage set.  So, handle_finalizers() should detect that and clear the finalizer rather than call it.  Once we get to delete_garbage() and start calling tp_clear(), we can't be running weakref callbacks or finalizers.  The GC logic goes through great pains to ensure that.

----------
nosy: +nascheme

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


More information about the Python-bugs-list mailing list