Skip to content

gh-121084: Call _abc_registry_clear() when checking refleaks #121191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 30, 2024

dash_R_cleanup() now calls _abc_registry_clear() before calling again register().

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
@vstinner
Copy link
Member Author

Without this change, ./python -m test test_functools -R 3:3 complains about memory leaks. Output of different runs:

test_functools leaked [0, 1, 0] memory blocks, sum=1 (this is fine)
test_functools leaked [1, -1, 1] memory blocks, sum=1 (this is fine)
test_functools leaked [1, 0, 0] memory blocks, sum=1 (this is fine)
test_functools leaked [1, 0, -1] memory blocks, sum=0 (this is fine)

With this change, the leak is gone.

@vstinner vstinner merged commit c766ad2 into python:main Jul 1, 2024
39 checks passed
@vstinner vstinner deleted the abc_registry_clear branch July 1, 2024 09:03
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 1, 2024
…ythonGH-121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
(cherry picked from commit c766ad2)

Co-authored-by: Victor Stinner <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 1, 2024
…ythonGH-121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
(cherry picked from commit c766ad2)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jul 1, 2024

GH-121208 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 1, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jul 1, 2024

GH-121209 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Jul 1, 2024
vstinner added a commit that referenced this pull request Jul 1, 2024
…H-121191) (#121209)

gh-121084: Call _abc_registry_clear() when checking refleaks (GH-121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
(cherry picked from commit c766ad2)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit that referenced this pull request Jul 1, 2024
…H-121191) (#121208)

gh-121084: Call _abc_registry_clear() when checking refleaks (GH-121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
(cherry picked from commit c766ad2)

Co-authored-by: Victor Stinner <[email protected]>
Akasurde pushed a commit to Akasurde/cpython that referenced this pull request Jul 3, 2024
…ython#121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
…ython#121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…ython#121191)

dash_R_cleanup() now calls _abc_registry_clear() before calling again
register().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant