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-156371: Fix missing PyRefTracer_DESTROY events for trashcan objects by corona10 · Pull Request #156372 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Aug 25, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: PyRefTracer_DESTROY is not called for objects deferred by the trashcan mechanism #156371

Sorry, something went wrong.

Uh oh!

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

All reactions
@corona10
pythongh-156371: Fix missing PyRefTracer_DESTROY events for trashcan …
e2a6b49
…objects
@corona10
corona10 requested a review from ZeroIntensity as a code owner August 25, 2026 16:09
@bedevere-app bedevere-app Bot mentioned this pull request Aug 25, 2026
PyRefTracer_DESTROY is not called for objects deferred by the trashcan mechanism #156371
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Aug 25, 2026
@corona10 corona10 added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Aug 25, 2026
@corona10
corona10 requested a review from markshannon August 25, 2026 16:09
@corona10

corona10 commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

cc @markshannon

All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10

corona10 commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

cc @vstinner and @iritkatriel who reviewed #132280 :)

All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10
Add test code
03274d3
@corona10

corona10 commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

I've also added the test code for preventing future regression.

All reactions

Sorry, something went wrong.

Uh oh!

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

corona10 added 3 commits August 26, 2026 01:50
@corona10
fix
a38788d
@corona10
fix
991795a
@corona10
tsan fix
e3ed9a2
markshannon
markshannon requested changes Aug 26, 2026
View reviewed changes
Comment thread Objects/object.c Outdated
#ifdef Py_TRACE_REFS
_Py_ForgetReference(op);
#endif
_PyReftracerTrack(op, PyRefTracer_DESTROY);

@markshannon markshannon Aug 26, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't think this is right. This should be in _PyTrash_thread_destroy_chain()
The object is destroyed when the trashcan is emptied, not when the object is deposited.

Sorry, something went wrong.

Uh oh!

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

corona10 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@corona10 corona10 Aug 26, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Okay, it sounds better and I've applied your suggestion.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting core review labels Aug 26, 2026
@bedevere-app

bedevere-app Bot commented Aug 26, 2026

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@corona10
Address code review
c50f26f
@corona10
corona10 requested a review from markshannon August 26, 2026 12:39
@corona10
Improve speed at TSAN
49d1779
@corona10

corona10 commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting change review and removed awaiting changes labels Aug 26, 2026
@bedevere-app

bedevere-app Bot commented Aug 26, 2026

Copy link
Copy Markdown

Thanks for making the requested changes!

@markshannon: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

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

corona10 added 4 commits August 27, 2026 08:56
@corona10
Merge branch 'main' into pythongh-156371
fd3cb74
@corona10
fix
2e2bd7d
@corona10
Merge remote-tracking branch 'origin/pythongh-156371' into pythongh-1…
a1ee6d1
…56371
@corona10
Merge remote-tracking branch 'upstream/main' into pythongh-156371
3a23485
corona10
corona10 commented Sep 1, 2026
View reviewed changes
Comment thread Lib/test/test_capi/test_object.py
@support.requires_resource('cpu')
@support.skip_emscripten_stack_overflow()
@support.skip_wasi_stack_overflow()
def test_destroy_traced_for_trashcan_deferred_objects(self):

@corona10 corona10 Sep 1, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Same as: https://github.com/python/cpython/blob/main/Lib/test/test_capi/test_misc.py#L415-L426

Sorry, something went wrong.

Uh oh!

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

All reactions
@corona10

corona10 commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

@markshannon gentle ping?

All reactions

Sorry, something went wrong.

Uh oh!

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

markshannon
markshannon approved these changes Sep 1, 2026
View reviewed changes

@markshannon markshannon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good now, thanks.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting change review labels Sep 1, 2026
@corona10
corona10 enabled auto-merge (squash) September 1, 2026 17:16
@corona10
corona10 merged commit 3dfa574 into python:main Sep 1, 2026
57 of 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 Sep 1, 2026
@miss-islington-app

miss-islington-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

Sorry, @corona10, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 3dfa5745f47370e86f075d356da1f4519e3077ac 3.14
All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app miss-islington-app Bot assigned corona10 Sep 1, 2026
@miss-islington-app

miss-islington-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

Sorry, @corona10, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 3dfa5745f47370e86f075d356da1f4519e3077ac 3.13
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app

bedevere-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

GH-156789 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 Sep 1, 2026
@bedevere-app

bedevere-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

GH-156802 is a backport of this pull request to the 3.14 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.14 bugs and security fixes label Sep 1, 2026
@corona10 corona10 removed the needs backport to 3.13 only security fixes label Sep 1, 2026
@corona10
corona10 deleted the gh-156371 branch September 1, 2026 23:09
corona10 added a commit that referenced this pull request Sep 1, 2026
@corona10
[3.14] gh-156371: Fix missing PyRefTracer_DESTROY events for trashcan…
f6842dd
… objects (gh-156372) (gh-156802)

(cherry picked from commit 3dfa574)
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
@corona10 @clin1234
pythongh-156371: Fix missing PyRefTracer_DESTROY events for trashcan …
d7ee592
…objects (pythongh-156372)
corona10 added a commit to miss-islington/cpython that referenced this pull request Sep 30, 2026
@corona10
pythongh-156371: Fix missing PyRefTracer_DESTROY events for trashcan …
2844af0
…objects (pythongh-156372)

(cherry picked from commit 3dfa574)

Co-authored-by: Donghee Na <[email protected]>
corona10 added a commit that referenced this pull request Oct 10, 2026
@miss-islington @corona10
[3.15] gh-156371: Fix missing PyRefTracer_DESTROY events for trashcan…
d575000
… objects (gh-156372) (gh-156789)

gh-156371: Fix missing PyRefTracer_DESTROY events for trashcan objects (gh-156372)
(cherry picked from commit 3dfa574)

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

Reviewers

@markshannon markshannon markshannon approved these changes
@ZeroIntensity ZeroIntensity Awaiting requested review from ZeroIntensity ZeroIntensity is a code owner

Uh oh!

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

Assignees

@corona10 corona10

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.

2 participants

@corona10 @markshannon
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 01402503 — 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.