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-97922: Run the GC only on eval breaker by pablogsal · Pull Request #97920 · python/cpython

Conversation

@pablogsal

@pablogsal pablogsal commented Oct 5, 2022 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Execute the garbage collector only on the eval breaker #97922

Sorry, something went wrong.

Uh oh!

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

kumaraditya303 and markshannon reacted with rocket emoji
All reactions
  • 🚀 2 reactions
@bedevere-bot bedevere-bot added the awaiting core review label Oct 5, 2022
@pablogsal pablogsal changed the title Run the GC only on eval breaker bpo-97922: Run the GC only on eval breaker Oct 5, 2022
@pablogsal pablogsal changed the title bpo-97922: Run the GC only on eval breaker gh-97922: Run the GC only on eval breaker Oct 5, 2022
@pablogsal
pablogsal requested a review from markshannon October 5, 2022 18:38
arhadthedev
arhadthedev requested changes Oct 5, 2022
View reviewed changes

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

A minor typo.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

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

Comment thread Misc/NEWS.d/next/Core and Builtins/2022-10-05-11-37-15.gh-issue-97922.Zu9Bge.rst Resolved

Uh oh!

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

@pablogsal
pablogsal force-pushed the gc_scheduled branch 3 times, most recently from 5951465 to 1634d14 Compare October 5, 2022 22:37
@markshannon markshannon added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 5, 2022
@bedevere-bot

bedevere-bot commented Oct 5, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @markshannon for commit 1634d14 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 5, 2022
@markshannon

markshannon commented Oct 5, 2022

Copy link
Copy Markdown
Member

Looks good, but let's run the buildbots before merging.

All reactions

Sorry, something went wrong.

Uh oh!

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

pablogsal added 2 commits October 7, 2022 10:31
@pablogsal
Run the GC only on eval breaker
e6b7b2c
@pablogsal
Add news entry
52f3855
Signed-off-by: Pablo Galindo <[email protected]>
@pablogsal
pablogsal force-pushed the gc_scheduled branch from 1634d14 to 52f3855 Compare October 7, 2022 18:36
@brandtbucher

brandtbucher commented Oct 7, 2022

Copy link
Copy Markdown
Member

This fixes the new test:

diff --git a/Lib/test/test_frame.py b/Lib/test/test_frame.py
index 4b86a60d2f..4b5bb7f94a 100644
--- a/Lib/test/test_frame.py
+++ b/Lib/test/test_frame.py
@@ -277,7 +277,7 @@ def callback(phase, info):
             frame!
             """
             nonlocal sneaky_frame_object
-            sneaky_frame_object = sys._getframe().f_back
+            sneaky_frame_object = sys._getframe().f_back.f_back
             # We're done here:
             gc.callbacks.remove(callback)
All reactions

Sorry, something went wrong.

Uh oh!

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

brandtbucher
brandtbucher approved these changes Oct 7, 2022
View reviewed changes

@brandtbucher brandtbucher 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 mostly good! Just a couple of questions regarding eval breaker recomputation.

Also, would it be better to run the GC after signals, etc.? I would guess that prompt signal handling, etc. would be more important than prompt GC. I have a slight preference towards preserving the current behavior for when signals, etc. are handled and just moving the GC around, rather than potentially changing when everything else is handled too.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Modules/signalmodule.c Resolved

Uh oh!

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

Comment thread Python/ceval_gil.c Resolved

Uh oh!

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

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Oct 7, 2022
pablogsal and others added 3 commits October 7, 2022 16:12
@pablogsal
fixup! Add news entry
0bbc488
@pablogsal @brandtbucher
Update Python/ceval_gil.c
28426c2
Co-authored-by: Brandt Bucher <[email protected]>
@pablogsal
fixup! fixup! Add news entry
9a1592a
@pablogsal

pablogsal commented Oct 7, 2022

Copy link
Copy Markdown
Member Author

Also, would it be better to run the GC after signals, etc.?

Indeed, it makes sense. I moved it after signals and pending calls but before gil switching

All reactions

Sorry, something went wrong.

Uh oh!

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

@pablogsal
pablogsal requested a review from brandtbucher October 7, 2022 23:15
@pablogsal
Merge remote-tracking branch 'origin/gc_scheduled' into gc_scheduled
0d6c8c5
brandtbucher
brandtbucher approved these changes Oct 8, 2022
View reviewed changes

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

Cool, one more fixup:

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Python/ceval_gil.c Resolved

Uh oh!

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

@pablogsal @brandtbucher
Update Python/ceval_gil.c
0411480
Co-authored-by: Brandt Bucher <[email protected]>
@pablogsal
pablogsal merged commit 83eb827 into python:main Oct 8, 2022
@pablogsal
pablogsal deleted the gc_scheduled branch October 8, 2022 14:57
@bedevere-bot bedevere-bot removed the awaiting merge label Oct 8, 2022
carljm added a commit to carljm/cpython that referenced this pull request Oct 8, 2022
@carljm
Merge branch 'main' into typewatch
d67d6fd
* main:
  pythongh-68686: Retire eptag ptag scripts (python#98064)
  pythongh-97922: Run the GC only on eval breaker (python#97920)
  GitHub Workflows security hardening (python#96492)
  Add `@ezio-melotti` as codeowner for `.github/`. (python#98079)
  pythongh-97913 Docs: Add walrus operator to the index (python#97921)
  [doc] Fix broken links to C extensions accelerating stdlib modules (python#96914)
  pythongh-97822: Fix http.server documentation reference to test() function (python#98027)
  pythongh-91052: Add PyDict_Unwatch for unwatching a dictionary (python#98055)
  pythonGH-98023: Change default child watcher to PidfdChildWatcher on supported systems (python#98024)
  pythonGH-94182: Run the PidfdChildWatcher on the running loop (python#94184)
carljm added a commit to carljm/cpython that referenced this pull request Oct 9, 2022
@carljm
Merge branch 'main' into urllibnonet
132c32e
* main: (5519 commits)
  Minor edits to the Descriptor HowTo Guide (pythonGH-24901)
  Fix link to Lifecycle of a Pull Request in CONTRIBUTING (python#98102)
  pythonGH-94597: deprecate `SafeChildWatcher`, `FastChildWatcher` and `MultiLoopChildWatcher` child watchers  (python#98089)
  Auto-cancel old builds when new commit pushed to branch (python#98009)
  pythongh-95011: Migrate syslog module to Argument Clinic (pythonGH-95012)
  pythongh-68686: Retire eptag ptag scripts (python#98064)
  pythongh-97922: Run the GC only on eval breaker (python#97920)
  GitHub Workflows security hardening (python#96492)
  Add `@ezio-melotti` as codeowner for `.github/`. (python#98079)
  pythongh-97913 Docs: Add walrus operator to the index (python#97921)
  [doc] Fix broken links to C extensions accelerating stdlib modules (python#96914)
  pythongh-97822: Fix http.server documentation reference to test() function (python#98027)
  pythongh-91052: Add PyDict_Unwatch for unwatching a dictionary (python#98055)
  pythonGH-98023: Change default child watcher to PidfdChildWatcher on supported systems (python#98024)
  pythonGH-94182: Run the PidfdChildWatcher on the running loop (python#94184)
  pythongh-92886: make test_ast pass with -O (assertions off) (pythonGH-98058)
  pythongh-92886: make test_coroutines pass with -O (assertions off) (pythonGH-98060)
  pythongh-57179: Add note on symlinks for os.walk (python#94799)
  pythongh-94808: Fix regex on exotic platforms (python#98036)
  pythongh-90085: Remove vestigial -t and -c timeit options (python#94941)
  ...
mpage pushed a commit to mpage/cpython that referenced this pull request Oct 11, 2022
@pablogsal @mpage
pythongh-97922: Run the GC only on eval breaker (python#97920)
65d36ba
@yilei yilei mentioned this pull request Dec 16, 2023
Deadlock in threaded application when using sys._current_frames #106883
Closed
This was referenced Dec 31, 2023
Reproducible garbage collection-related segfaults on Python 3.12 JuliaPy/PyCall.jl#1072
Closed
Segfaults on 3.12 when using PySR and running Julia's GC #113591
Closed
@jaemolihmbot jaemolihmbot mentioned this pull request Sep 21, 2026
CI: intermittent segfault — PyCall finalizers run on a Julia worker thread during the plotting tests jaemolihm/ElectronPhonon.jl#49
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@arhadthedev arhadthedev arhadthedev requested changes
@brandtbucher brandtbucher brandtbucher approved these changes
@markshannon markshannon Awaiting requested review from markshannon

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.

5 participants

@pablogsal @bedevere-bot @markshannon @brandtbucher @arhadthedev
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.