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

Pablo Galindo Salgado report at bugs.python.org
Mon Sep 2 11:44:02 EDT 2019


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

Unless we are missing something I think this may be caused by something in cffi that is not implementing gc-related functions correctly, as PyObject_ClearWeakRefs should not be called from a gc run. Given how complicated this is and even if the possible solution is to fix the problem in cffi or elsewhere, we can add an extra check in PyObject_ClearWeakRefs to NOT call callbacks that are in the process of being collected. Technically we should never reach that code, but we won't be segfaulting and the cost is a redundant-check that will be false in the normal path.

----------

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


More information about the Python-bugs-list mailing list