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 — bpo-1635741: Port gc module to multiphase initialization by tiran · Pull Request #23377 · python/cpython

Conversation

@tiran

@tiran tiran commented Nov 18, 2020 •
edited by miss-islington
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Signed-off-by: Christian Heimes [email protected]

https://bugs.python.org/issue1635741

Automerge-Triggered-By: GH:tiran

Sorry, something went wrong.

Uh oh!

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

All reactions
@tiran
tiran requested a review from pablogsal as a code owner November 18, 2020 19:34
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Nov 18, 2020
@bedevere-bot bedevere-bot added the awaiting core review label Nov 18, 2020
@tiran
tiran force-pushed the bpo-1635741-gc branch from a6884f9 to 668780e Compare November 18, 2020 19:38
@pablogsal pablogsal added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 18, 2020
@bedevere-bot

bedevere-bot commented Nov 18, 2020

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 668780e30978e11065113c438850074f3fefab5b 🤖

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 Nov 18, 2020
@pablogsal

pablogsal commented Nov 18, 2020

Copy link
Copy Markdown
Member

LGTM, but I added the buildbot label because the gc module has some special handling on deallocation

All reactions

Sorry, something went wrong.

Uh oh!

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

@tiran

tiran commented Nov 18, 2020

Copy link
Copy Markdown
Member Author

refleak bots are complaining about a new reference like in test_ast.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tiran
tiran requested review from corona10 and vstinner November 18, 2020 23:38
@tiran

tiran commented Nov 19, 2020

Copy link
Copy Markdown
Member Author

refleak bots are complaining about a new reference like in test_ast.

Found it! gcstate->garbage is initialized much earlier at the beginning of an interpreter lifecycle.

All reactions

Sorry, something went wrong.

Uh oh!

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

@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 19, 2020
@bedevere-bot

bedevere-bot commented Nov 19, 2020

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit d1d2cbcb6b14b2f2d8464cb56095b44a4e118ac6 🤖

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 Nov 19, 2020
vstinner
vstinner reviewed Nov 19, 2020
View reviewed changes
Comment thread Modules/gcmodule.c Outdated

@vstinner vstinner Nov 19, 2020

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.

This looks wrong to me. If you create multiple instances of the GC modul, callbacks member will be overriden by a new list at each call. It must be initialized exactly once in _PyGC_Init().

By the way, if (gcstate->garbage == NULL) { test in _PyGC_Init() can be removed, it's useless. This function is called exactly once per interpreter.

Sorry, something went wrong.

Uh oh!

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

All reactions

@tiran tiran Nov 19, 2020

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.

Makes sense, I'm moving gcstate->callbacks = PyList_New(0) to _PyGC_Init().

Sorry, something went wrong.

Uh oh!

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

All reactions
tiran added 2 commits November 19, 2020 08:53
@tiran
bpo-1635741: Port gc module to multiphase initialization
271e017
Signed-off-by: Christian Heimes <[email protected]>
@tiran
Fix reference leak
331d676
Signed-off-by: Christian Heimes <[email protected]>
vstinner
vstinner reviewed Nov 19, 2020
View reviewed changes
Comment thread Modules/gcmodule.c Resolved

Uh oh!

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

Comment thread Modules/gcmodule.c Resolved

Uh oh!

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

@tiran
Create gc callbacks in _PyGC_init()
7ad98d9
@tiran
tiran force-pushed the bpo-1635741-gc branch from d1d2cbc to 7ad98d9 Compare November 19, 2020 08:01
@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 19, 2020
@bedevere-bot

bedevere-bot commented Nov 19, 2020

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit 7ad98d9 🤖

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 Nov 19, 2020
vstinner
vstinner approved these changes Nov 19, 2020
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.

Sorry, something went wrong.

Uh oh!

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

tiran reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Nov 19, 2020
@tiran tiran added the 🤖 automerge label Nov 19, 2020
@miss-islington

miss-islington commented Nov 19, 2020

Copy link
Copy Markdown
Contributor

@tiran: Status check is done, and it's a pending ❌ .

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington

miss-islington commented Nov 19, 2020

Copy link
Copy Markdown
Contributor

@tiran: Status check is done, and it's a success ✅ .

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington
miss-islington merged commit 646d7fd into python:master Nov 19, 2020
@bedevere-bot bedevere-bot removed the awaiting merge label Nov 19, 2020
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
@tiran @adorilson
bpo-1635741: Port gc module to multiphase initialization (pythonGH-23377
50e5184
)

Signed-off-by: Christian Heimes <[email protected]>

Automerge-Triggered-By: GH:tiran
@kylotan kylotan mannequin mentioned this pull request Sep 19, 2022
Py_Finalize() doesn't clear all Python objects at exit #44470
Closed
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
@pablogsal pablogsal Awaiting requested review from pablogsal
@corona10 corona10 Awaiting requested review from corona10

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.

6 participants

@tiran @bedevere-bot @pablogsal @miss-islington @vstinner @the-knights-who-say-ni
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.