JIT: Propagate trace too long from zend_jit_trace_record_fake_init_call() - #23569
Open
arnaud-lb wants to merge 1 commit into
Open
JIT: Propagate trace too long from zend_jit_trace_record_fake_init_call()#23569arnaud-lb wants to merge 1 commit into
arnaud-lb wants to merge 1 commit into
Conversation
…ll() 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, already past the limit, was returned as a success. Report the failure as -(int)ZEND_JIT_TRACE_STOP_TOO_LONG 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 097edc8). 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, which would have been propagated as ZEND_JIT_TRACE_STOP_RECURSIVE_CALL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)stopinstead.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 097edc8).BAD_FUNCis 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