Closed
Description
Because the object we pass into the callback is dead (zero refcount), and if the callback raises an error we try to PyErr_WriteUnraisable
with that object as context, which increfs and decrefs it, which recursively again tries to deallocate it, and we end up in infinite recursion and overflowing the stack.
There are various other ways a callback could trigger this issue. We shouldn't pass around dead objects; instead *_dealloc
should temporarily resurrect it before calling the callback.