Files
cpython/Include/internal
Miss Islington (bot) 636946f413 [3.14] gh-148144: Initialize visited on copied interpreter frames (GH-148143) (#148147)
gh-148144: Initialize visited on copied interpreter frames (GH-148143)

_PyFrame_Copy() copied interpreter frames into generator and
frame-object storage without initializing the visited byte. Incremental
GC later reads frame->visited in mark_stacks() on non-start passes, so
copied frames could expose an uninitialized value once they became live
on a thread stack again.

Reset visited when copying a frame so copied frames start with defined
GC bookkeeping state. Preserve lltrace in Py_DEBUG builds.
(cherry picked from commit fbfc6ccb0a)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2026-04-05 23:49:47 +00:00
..