Skip to content

[3.14] gh-159739: Keep SQLite list parameters alive while binding (GH-160192) - #160362

Merged
JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-4df47d8-3.14
Oct 23, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-4df47d8-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

When a SQL parameter sequence is an exact list, sqlite3 retrieved an element as a borrowed reference before taking ownership. On free-threaded builds another thread can replace it in between, so binding can use a freed object and crash. Fetch a strong reference atomically. Backport to 3.15 and 3.14.
(cherry picked from commit 4df47d8)

Co-authored-by: Jelle Zijlstra jelle@openai.com

…honGH-160192)

When a SQL parameter sequence is an exact list, sqlite3 retrieved an element as a borrowed reference before taking ownership. On free-threaded builds another thread can replace it in between, so binding can use a freed object and crash. Fetch a strong reference atomically. Backport to 3.15 and 3.14.
(cherry picked from commit 4df47d8)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
@JelleZijlstra
JelleZijlstra enabled auto-merge (squash) October 22, 2026 22:23
@JelleZijlstra
JelleZijlstra merged commit cd04626 into python:3.14 Oct 23, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-4df47d8-3.14 branch October 23, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants