New submission from hydroflask <hydrofl...@yqxmail.com>:

pysqlite_connection_dealloc() calls sqlite3_close{,_v2}(). This can cause a 
deadlock if sqlite3_close() tries to acquire a lock that another thread  holds, 
due to a deadlock between the GIL and an internal sqlite3 lock.

This is especially common with sqlite3's "shared cache mode."

Since the GIL should not be released during a tp_dealloc function and python 
has no control over the behavior of sqlite3_close(), it is incorrect to call 
sqlite3_close() in pysqlite_connection_dealloc().

----------
components: Library (Lib)
messages: 383471
nosy: hydroflask
priority: normal
severity: normal
status: open
title: Deadlock in pysqlite_connection_dealloc()
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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

Reply via email to