GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-155781: Hold strong references to sqlite3 converters by cuishuang · Pull Request #155784 · python/cpython

Conversation

@cuishuang

@cuishuang cuishuang commented Aug 14, 2026

Copy link
Copy Markdown
Contributor
  • Issue: sqlite3 converter lookup can crash during concurrent registry updates in free-threaded builds #155781

Use PyDict_GetItemRef() when looking up registered SQLite converters so the converter remains alive until it has been added to the cursor's row cast map.

Update the caller's reference ownership and add a free-threading regression test that concurrently builds row cast maps and modifies the public converter registry.

Tests:

  • ./python -m test -v test_free_threading.test_sqlite3
  • ./python -m test -v test_sqlite3
  • make patchcheck

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cuishuang
cuishuang requested a review from erlend-aasland as a code owner August 14, 2026 11:18
@bedevere-app bedevere-app Bot added the awaiting review label Aug 14, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Aug 14, 2026
sqlite3 converter lookup can crash during concurrent registry updates in free-threaded builds #155781
Closed
davidlowryduda
davidlowryduda reviewed Aug 15, 2026
View reviewed changes
Comment thread Modules/_sqlite/cursor.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@cuishuang
pythongh-155781: Hold strong references to sqlite3 converters
0df980d
@cuishuang
cuishuang force-pushed the fix-sqlite-converter-ref-race branch from 56d5ed3 to 0df980d Compare August 16, 2026 00:18
kumaraditya303
kumaraditya303 reviewed Aug 20, 2026
View reviewed changes
Comment thread Modules/_sqlite/cursor.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@cuishuang
pythongh-155781: Hold strong references to sqlite3 converters
88d3efe
Signed-off-by: cuishuang <[email protected]>
kumaraditya303
kumaraditya303 approved these changes Aug 21, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Aug 21, 2026
@kumaraditya303
kumaraditya303 merged commit 65e149a into python:main Aug 21, 2026
58 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 21, 2026
@kumaraditya303 kumaraditya303 added the needs backport to 3.15 bugs and security fixes label Aug 21, 2026
@miss-islington-app

miss-islington-app Bot commented Aug 21, 2026

Copy link
Copy Markdown

Thanks @cuishuang for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Aug 21, 2026

Copy link
Copy Markdown

GH-156192 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Aug 21, 2026
hugovk pushed a commit that referenced this pull request Aug 29, 2026
@miss-islington @cuishuang
[3.15] gh-155781: Hold strong references to sqlite3 converters (GH-15…
bd519fc
…5784) (#156192)

Co-authored-by: cui fliter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kumaraditya303 kumaraditya303 kumaraditya303 approved these changes
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
+1 more reviewer
@davidlowryduda davidlowryduda davidlowryduda left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@cuishuang @davidlowryduda @kumaraditya303
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.