bpo-46465: Check eval breaker in specialized CALL opcodes#30826
bpo-46465: Check eval breaker in specialized CALL opcodes#30826Fidget-Spinner wants to merge 4 commits intopython:mainpython/cpython:mainfrom Fidget-Spinner:call_check_eval_breakerFidget-Spinner/cpython:call_check_eval_breakerCopy head branch name to clipboard
CALL opcodes#30826Conversation
|
I added |
vstinner
left a comment
There was a problem hiding this comment.
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 <vstinner@python.org>
Yeah I'd prefer another PR for that. I don't think those changes came with the |
Co-Authored-By: Mark Shannon <mark@hotpy.org>
|
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.
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