STINNER Victor <vstin...@python.org> added the comment:
Notes for myself. the visit_decref() has been updated to display repr() of the parent object, rather than display the "freed" object. Before: --- Modules/gcmodule.c:378: visit_decref: Assertion "!_PyObject_IsFreed(op)" failed <object at 0x5557629ca260 is freed> Fatal Python error: _PyObject_AssertFailed Python runtime state: preinitialized Current thread 0x00007f6e2863e740 (most recent call first): <no Python frame> --- After: --- Modules/gcmodule.c:378: visit_decref: Assertion "!_PyObject_IsFreed(op)" failed Enable tracemalloc to get the memory block allocation traceback object address : 0x7fe2d1a52b40 object refcount : 1 object type : 0x740be0 object type name: dict object repr : {'__repr__': <slot wrapper '__repr__' of 'weakref' objects>, '__hash__': <slot wrapper '__hash__' of 'weakref' objects>, '__call__': <slot wrapper '__call__' of 'weakref' objects>, '__lt__': <slot wrapper '__lt__' of 'weakref' objects>, '__le__': <slot wrapper '__le__' of 'weakref' objects>, '__eq__': <slot wrapper '__eq__' of 'weakref' objects>, '__ne__': <slot wrapper '__ne__' of 'weakref' objects>, '__gt__': <slot wrapper '__gt__' of 'weakref' objects>, '__ge__': <slot wrapper '__ge__' of 'weakref' objects>, '__init__': <slot wrapper '__init__' of 'weakref' objects>, '__new__': <built-in method __new__ of type object at 0x749500>, '__callback__': <member '__callback__' of 'weakref' objects>, '__doc__': None} Fatal Python error: _PyObject_AssertFailed Python runtime state: preinitialized Current thread 0x00007fe2dea35740 (most recent call first): <no Python frame> --- The problem was that the None object was seen as "freed" because _ob_prev=_ob_next=NULL. This object doesn't seem to be part of the list of all objects, sys.getobjects(). I fixed Py_None, but then I got the same assertion error on a different (moduledef) object. I gave up, and Pablo and me fixed _PyObject_IsFreed() instead. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38400> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com