hydroflask <hydrofl...@yqxmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue47019>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to