KEMBAR78
[3.13] gh-125859: Fix crash when `gc.get_objects` is called during GC (GH-125882) by miss-islington · Pull Request #125921 · python/cpython · GitHub
Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 24, 2024

This fixes a crash when gc.get_objects() or gc.get_referrers() is
called during a GC in the free threading build.

Switch to _PyObjectStack to avoid corrupting the struct worklist
linked list maintained by the GC. Also, don't return objects that are frozen
(gc.freeze()) or in the process of being collected to more closely match
the behavior of the default build.
(cherry picked from commit e545ead)

Co-authored-by: Sam Gross colesbury@gmail.com

…ythonGH-125882)

This fixes a crash when `gc.get_objects()` or `gc.get_referrers()` is
called during a GC in the free threading build.

Switch to `_PyObjectStack` to avoid corrupting the `struct worklist`
linked list maintained by the GC. Also, don't return objects that are frozen
(`gc.freeze()`) or in the process of being collected to more closely match
the behavior of the default build.
(cherry picked from commit e545ead)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@colesbury colesbury enabled auto-merge (squash) October 24, 2024 13:46
@colesbury colesbury merged commit 5c2696b into python:3.13 Oct 24, 2024
39 checks passed
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.

2 participants