Commit a7a96df
committed
JIT: Propagate trace too long from zend_jit_trace_record_fake_init_call()
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.1 parent 1053403 commit a7a96df
4 files changed
Lines changed: 139 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
| 631 | + | |
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
| 674 | + | |
| 675 | + | |
674 | 676 | | |
675 | | - | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
676 | 680 | | |
677 | 681 | | |
| 682 | + | |
678 | 683 | | |
679 | 684 | | |
680 | 685 | | |
681 | 686 | | |
682 | 687 | | |
| 688 | + | |
683 | 689 | | |
684 | 690 | | |
685 | 691 | | |
| |||
692 | 698 | | |
693 | 699 | | |
694 | 700 | | |
695 | | - | |
| 701 | + | |
696 | 702 | | |
697 | 703 | | |
698 | 704 | | |
| |||
810 | 816 | | |
811 | 817 | | |
812 | 818 | | |
813 | | - | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
814 | 823 | | |
815 | 824 | | |
816 | 825 | | |
817 | 826 | | |
818 | | - | |
| 827 | + | |
819 | 828 | | |
820 | 829 | | |
821 | 830 | | |
| |||
1199 | 1208 | | |
1200 | 1209 | | |
1201 | 1210 | | |
1202 | | - | |
| 1211 | + | |
1203 | 1212 | | |
1204 | 1213 | | |
1205 | 1214 | | |
| |||
1227 | 1236 | | |
1228 | 1237 | | |
1229 | 1238 | | |
1230 | | - | |
| 1239 | + | |
1231 | 1240 | | |
1232 | 1241 | | |
1233 | 1242 | | |
| |||
1364 | 1373 | | |
1365 | 1374 | | |
1366 | 1375 | | |
1367 | | - | |
| 1376 | + | |
1368 | 1377 | | |
1369 | 1378 | | |
1370 | 1379 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
0 commit comments