Skip to content

gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount()#151260

Open
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:deferred_refcount
Open

gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount()#151260
vstinner wants to merge 1 commit into
python:mainfrom
vstinner:deferred_refcount

Conversation

@vstinner

@vstinner vstinner commented Jun 10, 2026

Copy link
Copy Markdown
Member

Return 0 if the object is not tracked by the GC.

Return 0 if the object is not tracked by the GC.
@vstinner vstinner requested a review from ZeroIntensity as a code owner June 10, 2026 14:44
@vstinner vstinner added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 10, 2026
@vstinner

Copy link
Copy Markdown
Member Author

cc @ZeroIntensity @colesbury

@vstinner

Copy link
Copy Markdown
Member Author

I propose backporting the fix to 3.14 and 3.15 branches. Enabling deferred refcount on an object which is not tracked by the GC can lead to nasty bugs.

@vstinner

Copy link
Copy Markdown
Member Author

Tests / Sanitizers / TSan (free-threading) (pull_request): Failing after 23m

test_ssl failed.

So far, I failed to reproduce the issue locally. I built Python with ./configure --config-cache --with-thread-sanitizer --with-pydebug --disable-gil CC=clang LD=clang on Ubuntu 24.04. TSAN_OPTIONS='handle_segv=0' ./python -u -m test --tsan -v test_ssl 2>&1|tee log does not fail, but logs a warning when running test_sni_callback_race().

@vstinner

Copy link
Copy Markdown
Member Author

Tests / Sanitizers / TSan (free-threading) (pull_request): Failing after 23m
test_ssl failed.

I created #151268 to log the output when a TSAN test fails.

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_ssl being thread-unsafe is a known issue. This looks right.

@vstinner

Copy link
Copy Markdown
Member Author

I created #151277 for the TSan+test_ssl issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants