Skip to content

[3.14] gh-148144: Initialize visited on copied interpreter frames (GH-148143)#148147

Merged
pablogsal merged 1 commit intopython:3.14from
miss-islington:backport-fbfc6cc-3.14
Apr 5, 2026
Merged

[3.14] gh-148144: Initialize visited on copied interpreter frames (GH-148143)#148147
pablogsal merged 1 commit intopython:3.14from
miss-islington:backport-fbfc6cc-3.14

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Apr 5, 2026

_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 fbfc6cc)

Co-authored-by: Pablo Galindo Salgado Pablogsal@gmail.com

…honGH-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>
@pablogsal pablogsal enabled auto-merge (squash) April 5, 2026 23:24
@pablogsal pablogsal merged commit 636946f into python:3.14 Apr 5, 2026
50 checks passed
@miss-islington miss-islington deleted the backport-fbfc6cc-3.14 branch April 5, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants