You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Eval breaker isn't checked when the optimizer produces small region executors in loops. #106101
For tier2 optimization, the VM replaces the JUMP_BACKWARD instruction with ENTER_EXECUTOR.
If the executor does not execute the whole loop it may not check the eval-breaker, resulting in uninterruptable loops.
The obvious fix is to add an eval-breaker check to ENTER_EXECUTOR.
I think that is also the correct fix.
Adding extra checks of the eval break is always correct. The effect on performance should be low, as we hope that transfers of control from the interpreter to optimized code will be relatively rare.
changed the title [-]Eval breaker isn't check if optimizer produces small region executors in loops.[/-][+]Eval breaker isn't checked when the optimizer produces small region executors in loops.[/+]on Jun 26, 2023
I have a fix where each time upon entry into the Tier 2 interpreter we repeat the code from CHECK_EVAL_BREAKER(): 9df20bb
(I can't literally insert a call to the CHECK_EVAL_BREAKER() macro because that macro goes to a label; I could repeat that label but what it does is a little murky (it may either execute goto error or DISPATCH(). Either way it looks fragile.)
Activity
[-]Eval breaker isn't check if optimizer produces small region executors in loops.[/-][+]Eval breaker isn't checked when the optimizer produces small region executors in loops.[/+]gvanrossum commentedon Jun 26, 2023
I have a fix where each time upon entry into the Tier 2 interpreter we repeat the code from
CHECK_EVAL_BREAKER():9df20bb
(I can't literally insert a call to the
CHECK_EVAL_BREAKER()macro because that macro goes to a label; I could repeat that label but what it does is a little murky (it may either executegoto errororDISPATCH(). Either way it looks fragile.)markshannon commentedon Jul 4, 2023
Fixed by #106141