]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-140431: Fix GC crash due to partially initialized coroutines (gh-140470...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 23 Oct 2025 14:44:21 +0000 (16:44 +0200)
committerGitHub <noreply@github.com>
Thu, 23 Oct 2025 14:44:21 +0000 (14:44 +0000)
commit3944e9b3b24de994d46eb7f4af6eec49b3324271
tree59c9038bb1ca4a677e0cc52e4f8df70c0cdf1e4a
parent564bb00b2763d57d0379be5f522dd9a2b81b61f7
[3.14] gh-140431: Fix GC crash due to partially initialized coroutines (gh-140470) (gh-140504)

The `make_gen()` function creates and tracks generator/coro objects, but
doesn't fully initialize all the fields. At a minimum, we need to
initialize all the fields that may be accessed by gen_traverse because
the call to `compute_cr_origin()` can trigger a GC.
(cherry picked from commit 574405c19e9b5de0504be46a3925027ded4495ae)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Misc/NEWS.d/next/Core_and_Builtins/2025-10-22-17-22-22.gh-issue-140431.m8D_A-.rst [new file with mode: 0644]
Objects/genobject.c