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
JIT: segfault when an inlined call's reference argument changes from int to float (zend_jit_trace_exit assertion) #24389
With the tracing JIT, a function called in a hot loop with reference-bound variables crashes once the operand type changes from int to float: the release build segfaults and a debug build fails an assertion in zend_jit_trace_exit.
The script has no output and should simply run to completion. A more natural shape that also segfaults the release build (after printing 44850, where JIT off prints 44850 and 45000): foreach ($data as &$v) { $sum += calc($v, 1); } over an int array and then a float array, with calc doing the same arithmetic as right.
It still reproduces at 5ccc56b (latest upstream when checked): the release build segfaults (SIGSEGV) with the command above, and the debug build fails the same assertion (at line 8850 there; checked with the hot thresholds set to 1). The command uses the default JIT thresholds.
Looks like the type guard emitted for the register-allocated callee CVs on ZEND_JIT_TRACE_ENTER in zend_jit_trace.c (zend_jit_type_guard(&ctx, NULL, ...)) has no opline, so the exit trusts EX(opline) of the freshly pushed inlined frame, which is not initialised yet. PR #18392 (JIT: Don't reuse IP register for EX(call)) may be related; I did not test it, its diff does not apply on the latest commit.
I can send a patch if that helps.
Found with an LLM-based testing tool; I used Claude to reduce it and look for the cause.
Activity
ndossche commentedon Oct 18, 2026
Feel free to do so