-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
frame.setlineno has serious flaws. #94438
Copy link
Copy link
Closed
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done
The
frame_setlinenofunction works in in stages:The first steps is faulty (I think, I haven't demonstrated this) as it might be possible to jump to an instruction involved in frame creation. This should be easy to fix using the new
_co_firsttraceablefield.The second step has (at least) three flaws:
NULLs on the stack, making it possible to jump from a stack withNULLs to one that cannot handleNULLs.PUSH_EXC_INFOpushes three values. It only pushes one.Setting the line number of a frame is only possible in the debugger, so this isn't as terrible as might appear, but it definitely needs fixing.
Linked PRs
RuntimeWarningfor jump tests intest_sys_settrace#111341