Commit 7c69d4b
committed
Fix GH-21368 crash: use jit->current_op_array in escape_if_undef
#21368 dispatched to orig_handler via exit_info->op_array. That pointer
is set at parent-trace compile time from JIT_G(current_frame)->func, and
can become stale by the time a side trace compiles for that exit,
producing an access violation in zend_jit_escape_if_undef on long-lived
IIS+FastCGI workers.
Use jit->current_op_array instead. On the crash path
(zend_jit_compile_side_trace -> zend_jit_trace), zend_jit_trace_start
sets it to trace_buffer->op_array, which is freshly captured for the
current compilation and avoids the parent's potentially stale
reference. On the zend_jit_trace_exit_to_vm path,
zend_jit_deoptimizer_start leaves current_op_array unset, so set it
from exit_info->op_array there.
The gh21267 tests still pass.1 parent 391ec27 commit 7c69d4b
2 files changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8068 | 8068 | | |
8069 | 8069 | | |
8070 | 8070 | | |
8071 | | - | |
| 8071 | + | |
8072 | 8072 | | |
8073 | 8073 | | |
8074 | 8074 | | |
| |||
8094 | 8094 | | |
8095 | 8095 | | |
8096 | 8096 | | |
8097 | | - | |
| 8097 | + | |
8098 | 8098 | | |
8099 | 8099 | | |
8100 | 8100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3603 | 3603 | | |
3604 | 3604 | | |
3605 | 3605 | | |
3606 | | - | |
| 3606 | + | |
3607 | 3607 | | |
3608 | 3608 | | |
3609 | 3609 | | |
| |||
7374 | 7374 | | |
7375 | 7375 | | |
7376 | 7376 | | |
| 7377 | + | |
| 7378 | + | |
7377 | 7379 | | |
7378 | 7380 | | |
7379 | 7381 | | |
| |||
0 commit comments