Skip to content

gh-145197: Fix JIT trace crash when recording function from cleared generator frame#145220

Merged
markshannon merged 2 commits intopython:mainfrom
cocolato:fix-gh-145197
Feb 25, 2026
Merged

gh-145197: Fix JIT trace crash when recording function from cleared generator frame#145220
markshannon merged 2 commits intopython:mainfrom
cocolato:fix-gh-145197

Conversation

@cocolato
Copy link
Contributor

@cocolato cocolato commented Feb 25, 2026

In the JIT trace record path, _RECORD_NOS_GEN_FUNC originally reads the generator function object via _PyFrame_GetFunction(); when the generator frame has been cleared, this path may trigger a crash.

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting and fixing this

markshannon

This comment was marked as duplicate.

@markshannon markshannon merged commit 277a037 into python:main Feb 25, 2026
76 checks passed
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.

3 participants