]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-148144: Initialize visited on copied interpreter frames (GH-148143) (#148147)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 5 Apr 2026 23:49:47 +0000 (01:49 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Apr 2026 23:49:47 +0000 (23:49 +0000)
commit636946f41322a5efbde6a3efbb283e8d8efb3e32
treeecc7f4d5cd5239161b3a394e825849e7a642994d
parente99b801aeb9957a3351e6eb7417a21406ebfafef
[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 fbfc6ccb0abf362a0ecdc02cd0aa2d16c1a4ce44)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
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]