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
Assertion 'probable_callable != NULL' in optimize_uops when sys.settrace is set and cleared before a type-unstable method call loop crosses the JIT threshold #148716
CPython's JIT optimizer crashes with an assertion failure probable_callable != NULL in optimize_uops (Python/optimizer_cases.c.h:4307) when a tracing function is installed and immediately removed via sys.settrace, followed by a loop that calls a method on type-unstable objects enough times to cross the JIT compilation threshold. The optimizer fails to find a non-null callable when processing a CALL uop whose receiver type varies across iterations, causing the assertion to fire.
The JIT optimizer should handle the case where no single callable type can be determined for a polymorphic call site, and should either bail out of optimization or emit a safe fallback. It should not crash with an assertion failure.
The loop calls o.method(D) where o alternates between a Cls instance, an int, and a str across iterations. After enough iterations to trigger JIT compilation, optimize_uops processes the CALL uop for this call site and attempts to determine the most likely callable via probable_callable. Because the receiver type is not stable across iterations, probable_callable remains NULL — but the optimizer unconditionally dereferences it without a null guard, triggering the assertion. The prior sys.settrace install-and-clear sequence appears to affect the interpreter's specialization state in a way that causes the JIT to attempt optimization of this polymorphic call site rather than bailing out early.
changed the title [-][CPython][JIT/Optimizer] Assertion 'probable_callable != NULL' in optimize_uops when sys.settrace is set and cleared before a type-unstable method call loop crosses the JIT threshold[/-][+]Assertion 'probable_callable != NULL' in optimize_uops when sys.settrace is set and cleared before a type-unstable method call loop crosses the JIT threshold[/+]on Apr 18, 2026
Activity
[-][CPython][JIT/Optimizer] Assertion 'probable_callable != NULL' in optimize_uops when sys.settrace is set and cleared before a type-unstable method call loop crosses the JIT threshold[/-][+]Assertion 'probable_callable != NULL' in optimize_uops when sys.settrace is set and cleared before a type-unstable method call loop crosses the JIT threshold[/+]cocolato commentedon Apr 18, 2026
Same as: #148571. I'm solving it.
StanFromIreland commentedon Apr 18, 2026
@cocolato can it be closed as a duplicate then?
recorded_valuesleak when specialized op deopts #148571