-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-46465: Check eval breaker in specialized CALL
opcodes
#30826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-46465: Check eval breaker in specialized CALL
opcodes
#30826
Conversation
I added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the "error" label ends with DISPATCH(). It doesn't call CHECK_EVAL_BREAKER() even if we are coming from a CALL target which can get a signal (or any other reason to break the ceval).
I'm not sure that I like the test decorator, it makes a test 16x slower :-(
In Python 3.10, the error label ends with "goto main_loop" which does check for the ceval breaker atomic variable, no? |
CALL_NO_KW_PY_SIMPLE optimization goes to start_frame which ends with DISPATCH(): it seems like the CHECK_EVAL_BREAKER() check has been eaten by the optimization, between Python 3.10 and 3.11. Either start_frame or start_frame should call CHECK_EVAL_BREAKER(). |
The ceval.c change are enough for almost all TARGET, except CALL_NO_KW_PY_SIMPLE which miss CHECK_EVAL_BREAKER() somewhere, but it can be fixed in a separated PR (with a fix for "error" label ? ;-)) if you prefer. |
Co-Authored-By: Victor Stinner <[email protected]>
Yeah I'd prefer another PR for that. I don't think those changes came with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Co-Authored-By: Mark Shannon <[email protected]>
Strange, Ubuntu tests fail even on non-specialized code.
I'll look into it. |
|
||
# Tests both adaptive and specialized opcodes for proper | ||
# CHECK_EVAL_BREAKER(). See bpo-46465 for an example bug. | ||
@repeat_cpython_adaptative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've tested in https://bugs.python.org/issue46709 there several more test cases that require this decorator:
- testInterruptCaught
- testSecondInterrupt
- testTwoResults
Sorry, can I trouble someone here to take over this PR please? I can't complete it right now. |
@Fidget-Spinner I will cover your back 😉 |
https://bugs.python.org/issue46465