]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-148144: Initialize visited on copied interpreter frames (#148143)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Sun, 5 Apr 2026 23:23:07 +0000 (00:23 +0100)
committerGitHub <noreply@github.com>
Sun, 5 Apr 2026 23:23:07 +0000 (00:23 +0100)
commitfbfc6ccb0abf362a0ecdc02cd0aa2d16c1a4ce44
tree08df27fec8c03f17a0d102b82dceb91bae43ebab
parentbce96a181350f348560fe0623361f39a6d5c6361
gh-148144: Initialize visited on copied interpreter frames (#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.
Include/internal/pycore_interpframe.h
Misc/NEWS.d/next/Core_and_Builtins/2026-04-05-15-20-00.gh-issue-148144.f7qA0x.rst [new file with mode: 0644]