Skip to content

Initialize visited on copied interpreter frames#148140

Closed
pablogsal wants to merge 1 commit intopython:mainfrom
pablogsal:codex/init-copied-frame-visited
Closed

Initialize visited on copied interpreter frames#148140
pablogsal wants to merge 1 commit intopython:mainfrom
pablogsal:codex/init-copied-frame-visited

Conversation

@pablogsal
Copy link
Copy Markdown
Member

@pablogsal pablogsal commented Apr 5, 2026

No description provided.

_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.
@pablogsal pablogsal changed the title [codex] Initialize visited on copied interpreter frames Initialize visited on copied interpreter frames Apr 5, 2026
@pablogsal pablogsal closed this Apr 5, 2026
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.

1 participant