[php-src] PR #23569: JIT: Propagate trace too long from zend_jit_trace_record_fake_init_call()
| From: | arnaud-lb | Date: | Fri, 04 Sep 2026 16:24:50 +0000 |
| Subject: | [php-src] PR #23569: JIT: Propagate trace too long from zend_jit_trace_record_fake_init_call() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38308@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23569
Author: arnaud-lb
zend_jit_trace_record_fake_init_call() silently truncated its recording when the trace
buffer became full: TRACE_RECORD() broke out of the loop and the index was returned as
a success. Report the failure as -(int)stop instead.
The callers did check for a negative result, but mapped it to
ZEND_JIT_TRACE_STOP_BAD_FUNC, which dates back to the time when -1 meant "this
pending call can't be traced" (those returns were replaced by "continue
recording" in 097edc86c82). BAD_FUNC is a successful stop reason, so the truncated
recording (a start record, a partial fake init call sequence and an end record) is handed to the
trace compiler; at trace start this produces a trace that loops forever. Propagate the reported stop
reason instead, so that the incomplete recording is discarded as too long.
zend_jit_trace_subtrace() now reports its own failure the same way instead of returning
a bare -1.
cc @iliaal