STINNER Victor <vstin...@python.org> added the comment:
asyncio_gc.py: script to reproduce bpo-20526 (copied from there), but ported to Python 3.9 (replace asyncio.async with asyncio.ensure_future). Sadly, Python with PR 18848 does crash when running asyncio_gc.py if I press CTRL+c twice: * A thread does crash in _PyObject_GC_TRACK_impl() called indirectly by select_epoll_poll_impl(), in a Python thread * while main thread is exiting Python: Py_FinalizeEx() is calling _PyImport_Cleanup() which blocks on take_gil() It seems like the main thread does *not* hold the hold, the thread which crashed does. It should not happen: _PyRuntimeState_SetFinalizing(runtime, tstate) has been called and so no other thread should be able to take the GIL anymore, but exit immediately. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue19466> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com