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-133261: Make sure that the GC doesn't untrack objects in trashcan by markshannon · Pull Request #133431 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented May 5, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The trashcan stores pointers in the reference count field. This could make the object appear immortal causing the GC to untrack it.
This PR makes sure that those pointers are stored in such a way as to never appear immortal.

  • Issue: test_frame does crash randomly on Linux (x86-64, ppc64le, s390x) #133261

Sorry, something went wrong.

Uh oh!

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

chris-eibl reacted with rocket emoji
All reactions
  • 🚀 1 reaction
markshannon added 2 commits May 5, 2025 12:01
@markshannon
Make sure that the GC doesn't untrack objects in trashcan
372eabc
@markshannon
Add news
c18073c
@bedevere-app bedevere-app Bot mentioned this pull request May 5, 2025
test_frame does crash randomly on Linux (x86-64, ppc64le, s390x) #133261
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label May 5, 2025
@markshannon
Make functions static
ee95803
vstinner
vstinner reviewed May 5, 2025
View reviewed changes
Comment thread Objects/object.c Resolved

Uh oh!

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

markshannon added 2 commits May 5, 2025 12:46
@markshannon
Helpers are needed for no-gil build
cb357f9
@markshannon
Functions aren't needed for no-gil build
48a244d
vstinner
vstinner approved these changes May 5, 2025
View reviewed changes

@vstinner vstinner 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.

LGTM.

This change can explain a lot of very weird bugs and crashes that I saw last days on buildbots and GitHub CIs.

Sorry, something went wrong.

Uh oh!

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

chris-eibl reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels May 5, 2025
@vstinner

vstinner commented May 5, 2025

Copy link
Copy Markdown
Member

Tests / Hypothesis tests on Ubuntu (pull_request)Failing after 7m

test_external_inspection failed:

FAIL: test_async_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace) (task_factory_variant='asyncio.new_event_loop')

I wrote a fix for this one: #133433.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented May 5, 2025

Copy link
Copy Markdown
Member

Without this change, test_frame crash after a few attempts (between 1 and 3).

With this change, test_frame does no longer crash. I ran ./python -u -m test -j2 -F test_frame for 3 minutes:

0:03:46 load avg: 3.06 [211] test_frame passed
0:03:47 load avg: 3.06 [212] test_frame passed
...
All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon
markshannon merged commit f554237 into python:main May 5, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label May 5, 2025
@vstinner

vstinner commented May 5, 2025

Copy link
Copy Markdown
Member

With this change, #133199 (gh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack()) can also be reverted: test_functools no longer crash.

efimov-mikhail reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@vstinner vstinner mentioned this pull request May 5, 2025
test_frame.test_repr_deep() fails randomly on Windows11 Bigmem buildbot: _PyObject_GC_UNTRACK() assertion error #133384
Closed
@bedevere-bot

bedevere-bot commented May 5, 2025

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86 Debian Non-Debug with X 3.x (no tier) has failed when building commit f554237.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1245/builds/5317) and take a look at the build logs.
  4. Check if the failure is related to this commit (f554237) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1245/builds/5317

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (test.test_exceptions.ExceptionTests.testInvalidTraceback) ... �[32mok�[0m


Traceback (most recent call last):
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/support/__init__.py"�[0m, line �[35m2876�[0m, in �[35mwrapper�[0m
    return func(*args, **kwargs)
  File �[35m"/buildbot/buildarea/3.x.ware-debian-x86.nondebug/build/Lib/test/test_exceptions.py"�[0m, line �[35m1518�[0m, in �[35mtest_recursion_normalizing_infinite_exception�[0m
    �[31mself.assertEqual�[0m�[1;31m(rc, 1)�[0m
    �[31m~~~~~~~~~~~~~~~~�[0m�[1;31m^^^^^^^�[0m
�[1;35mAssertionError�[0m: �[35m-6 != 1�[0m


Traceback (test.test_exceptions.ExceptionTests.testWithTraceback) ... �[32mok�[0m


TracebackAttr (test.test_exceptions.ExceptionTests.testNoneClearsTracebackAttr) ... �[32mok�[0m
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented May 5, 2025

Copy link
Copy Markdown
Member

Hi! The buildbot x86 Debian Non-Debug with X 3.x (no tier) has failed when building commit f554237.

That's not good, many tests failed with Assertion '!_Py_IsImmortal(op)' failed:

13 tests failed:
    test_call test_capi test_ctypes test_descr test_dict
    test_dictviews test_exception_group test_exceptions test_frame
    test_functools test_isinstance test_json test_list
All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon

markshannon commented May 5, 2025

Copy link
Copy Markdown
Member Author

That's a 32 bit machine, right?
I'll take a look.

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon
markshannon deleted the fix-133261 branch May 6, 2025 08:21
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@markshannon @Pranjal095
pythonGH-133261: Make sure that the GC doesn't untrack objects in tra…
151c80d
…shcan (pythonGH-133431)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes

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

@markshannon @vstinner @bedevere-bot
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.