8000 [3.12] gh-111777: Fix assertion errors on incorrectly still-tracked GC object destruction (GH-111778) by miss-islington · Pull Request #111989 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] gh-111777: Fix assertion errors on incorrectly still-tracked GC object destruction (GH-111778) #111989

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 1 commit into from
Nov 12, 2023

Conversation

miss-islington
Copy link
Contributor
@miss-islington miss-islington commented Nov 12, 2023

In PyObject_GC_Del, in Py_DEBUG mode, when warning about GC objects that
were not properly untracked before starting destruction, take care to
untrack the object before warning, to avoid triggering a GC run and
causing the problem the code tries to warn about. Also make sure to save and
restore any pending exceptions, which the warning would otherwise clobber or
trigger an assertion error on.
(cherry picked from commit ce6a533)

Co-authored-by: T. Wouters thomas@python.org

… object destruction (pythonGH-111778)

In PyObject_GC_Del, in Py_DEBUG mode, when warning about GC objects that
were not properly untracked before starting destruction, take care to
untrack the object _before_ warning, to avoid triggering a GC run and
causing the problem the code tries to warn about. Also make sure to save and
restore any pending exceptions, which the warning would otherwise clobber or
trigger an assertion error on.
(cherry picked from commit ce6a533)

Co-authored-by: T. Wouters <thomas@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
39EC
Development

Successfully merging this pull request may close these issues.

2 participants
0