SIGN IN SIGN UP

[3.13] gh-125859: Fix crash when `gc.get_objects` is called during GC (GH-125882) (GH-125921)

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 e545ead66ce725aae6fb0ad5d733abe806c19750)

Co-authored-by: Sam Gross <colesbury@gmail.com>
M
Miss Islington (bot) committed
5c2696bc261905b84c71ddbee3f439af568a8795
Parent: e334022
Committed by GitHub <noreply@github.com> on 10/24/2024, 2:08:15 PM