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.

classification
Title: SQLite: segfault if backup called on closed database
Type: crash Stage: commit review
Components: Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: aeros, ghaering, lukasz.langa, miss-islington, pdmccormick, python-dev
Priority: normal Keywords: patch

Created on 2020-09-19 16:08 by pdmccormick, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix.patch pdmccormick, 2020-09-19 16:08
Pull Requests
URL Status Linked Edit
PR 22322 merged python-dev, 2020-09-19 16:11
PR 22344 merged miss-islington, 2020-09-21 21:42
PR 22345 merged miss-islington, 2020-09-21 21:42
Messages (8)
msg377176 - (view) Author: Peter McCormick (pdmccormick) * Date: 2020-09-19 16:08
Attempting to backup a closed database will trigger segfault:

```
target = sqlite.connect(':memory:')
source = sqlite.connect(":memory:")
source.close()
source.backup(target)
```
msg377201 - (view) Author: Kyle Stanley (aeros) * (Python committer) Date: 2020-09-20 02:36
With this being a segfault that's simple to replicate under normal circumstances, I've elevated the priority to release blocker. I'll wait on the release manager (Lukasz) for explicit approval for backporting to 3.9 and 3.8, with both branches being in the release candidate phase.

(The attached PR looks to be ready to be merged as well, after a Misc/NEWS entry is added by the author. See https://github.com/python/cpython/pull/22322#pullrequestreview-492167467 for details.)
msg377203 - (view) Author: Peter McCormick (pdmccormick) * Date: 2020-09-20 03:22
Updated sample script, thanks to @aeros for catching the omission:

```
import sqlite3
target = sqlite3.connect(':memory:')
source = sqlite3.connect(':memory:')
source.close()
source.backup(target)
```
msg377204 - (view) Author: miss-islington (miss-islington) Date: 2020-09-20 03:40
New changeset bfee9fad84531a471fd7864e88947320669f68e2 by Peter McCormick in branch 'master':
bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
https://github.com/python/cpython/commit/bfee9fad84531a471fd7864e88947320669f68e2
msg377287 - (view) Author: miss-islington (miss-islington) Date: 2020-09-21 22:00
New changeset ca2d99d091a5b7768e92ee5ce7104aa6d8a3ed86 by Miss Islington (bot) in branch '3.8':
bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
https://github.com/python/cpython/commit/ca2d99d091a5b7768e92ee5ce7104aa6d8a3ed86
msg377289 - (view) Author: miss-islington (miss-islington) Date: 2020-09-21 22:05
New changeset 4ee30c42441c3e5066d5080a22da53675aeae716 by Miss Islington (bot) in branch '3.9':
bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
https://github.com/python/cpython/commit/4ee30c42441c3e5066d5080a22da53675aeae716
msg377290 - (view) Author: Kyle Stanley (aeros) * (Python committer) Date: 2020-09-21 22:07
I've received approval from Lukasz to backport to 3.9 and 3.8, and have now merged the PRs.

It could use a post-commit review from a core dev that has some additional experience with SQLite3, but it can be de-escalated from release blocker.
msg378052 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2020-10-05 16:10
New changeset bd55c46895d2fcfadda46701d3c34d78441a7806 by Łukasz Langa (Miss Islington (bot)) in branch '3.9':
bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
https://github.com/python/cpython/commit/bd55c46895d2fcfadda46701d3c34d78441a7806
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85981
2020-10-05 16:10:19lukasz.langasetmessages: + msg378052
2020-09-21 22:07:57aerossetpriority: release blocker -> normal
status: open -> closed
messages: + msg377290

stage: patch review -> commit review
2020-09-21 22:05:25miss-islingtonsetmessages: + msg377289
2020-09-21 22:00:44miss-islingtonsetmessages: + msg377287
2020-09-21 21:42:09miss-islingtonsetpull_requests: + pull_request21386
2020-09-21 21:42:00miss-islingtonsetpull_requests: + pull_request21385
2020-09-20 03:40:59miss-islingtonsetnosy: + miss-islington
messages: + msg377204
2020-09-20 03:22:12pdmccormicksetmessages: + msg377203
2020-09-20 02:36:30aerossetnosy: + ghaering
2020-09-20 02:36:14aerossetpriority: normal -> release blocker
versions: - Python 3.7
nosy: + lukasz.langa, aeros

messages: + msg377201
2020-09-19 16:11:40python-devsetnosy: + python-dev

pull_requests: + pull_request21367
stage: patch review
2020-09-19 16:08:19pdmccormickcreate