This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hydroflask
Recipients erlendaasland, hydroflask, pablogsal, vstinner
Date 2022-03-15.19:54:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647374097.38.0.108637301299.issue47019@roundup.psfhosted.org>
In-reply-to
Content
So what is causing this bug in 3.10 is the following stack:

thread_entry_point()
  PyGILState_Ensure()
  PyGILState_Release()
    ...
      PyGILState_Ensure()

The core issue is that PyGILState_Ensure is getting called while the tstate itself is in the process of being destroyed. This causes an invalid state and eventually results in a segfault or "Fatal Python Error."

I think the most robust fix is to allow re-entrancy to PyGILState_Release/PyGILState_Ensure. If that is prohibitively complex and/or is not specified to be allowed, I believe the most robust fix is to avoid using sqlite3 destructor callbacks to DECREF Python objects.
History
Date User Action Args
2022-03-15 19:54:57hydroflasksetrecipients: + hydroflask, vstinner, pablogsal, erlendaasland
2022-03-15 19:54:57hydroflasksetmessageid: <1647374097.38.0.108637301299.issue47019@roundup.psfhosted.org>
2022-03-15 19:54:57hydroflasklinkissue47019 messages
2022-03-15 19:54:57hydroflaskcreate