Niels Dossche
f4fb77ed61
Fix GH-17257: UBSAN warning in ext/opcache/jit/zend_jit_vm_helpers.c
...
EX(opline) / opline can be stale if the IP is not stored, like in this
case on a trace enter. We always need to make sure that the opline is up
to date to make sure we don't use stale data.
Closes GH-17260.
2024-12-26 12:26:48 +01:00
Dmitry Stogov
f8d2e00964
Fix GH-17190: Assertion failure ext/opcache/jit/ir/ir_gcm.c ( #17221 )
2024-12-20 10:59:33 +03:00
Dmitry Stogov
33c12e0776
Update IR
...
IR commit: 79483000c2a4b918221fa3097ca47b48b3519447
2024-12-19 20:29:35 +03:00
Dmitry Stogov
6666cc83c5
Fix RC inference of op1 of FETCH_OBJ and INIT_METHOD_CALL
...
Fixes GH-17151
Closes GH-17152
2024-12-18 19:08:51 +01:00
Niels Dossche
2104097a79
Fix GH-17140 (Assertion failure in JIT trace exit with ZEND_FETCH_DIM_FUNC_ARG)
...
ZEND_FETCH_DIM_FUNC_ARG should also be repeated on undefined access,
consistent to how ZEND_FETCH_DIM_R is handled. The opcode was just
missing from the assertion list.
Closes GH-17148.
Co-authored-by: Dmitry Stogov <dmitry@zend.com >
2024-12-16 19:46:11 +01:00
Dmitry Stogov
ccc6c0f78c
Fix GH-15709: Crashing tests on Windows x64 ( #17095 )
...
This is a quick fix for the problem.
It'll work while all the JIT-ed functions have the same "fixed stack frame".
Unwinder uses hard-coded unwind data for this "fixed stack frame".
* Preallocate space for Win64 shadow args
* typo
* Setup unwinder for JIT functions
* Revert "Dynamically xfail test case which fails on CI"
This reverts commit 7cc327fd5a .
* Revert "Dynamically xfail test case which fails on CI"
This reverts commit bdde797159 .
* Revert "Dynamically xfail test cases which fail on CI (GH-15710)"
This reverts commit 6d5962074f .
* Remove XFAIL sections
* Add hard-coded SEH unwind data for EXITCALL
* Fix unwind data
* Fix Windows multi-process support
* Typo
2024-12-13 02:05:45 +03:00
Dmitry Stogov
5ab2c02ea1
Fix GH-9011: Assertion failure with tracing JIT ( #17042 )
...
* Fix GH-9011: Assertion failure with tracing JIT
* Temporay SKIP the test on 64-bit Windows because of GH-15709
2024-12-04 19:49:17 +03:00
Dmitry Stogov
89b82ef709
Fix GH-16996: 8.4 tracing JIT phpseclib failures ( #17030 )
...
* Fix GH-16996: 8.4 tracing JIT phpseclib failures
This prevents conflicts caused by spilling to bound PHP stack slots by
creating copies.
* Fix build
2024-12-03 20:43:15 +03:00
Dmitry Stogov
c5ce74c88c
Fix GH-17003: Pecl 8.4 tracing JIT crash ( #17032 )
2024-12-03 20:42:27 +03:00
Dmitry Stogov
f04a9f466f
Update IR
...
IR commit: 1a41bddcf0a41b9a3866d00b57591b3684c88443
2024-12-03 13:01:31 +03:00
Dmitry Stogov
03bb112fb2
Fix GH-16984: function JIT overflow bug ( #17015 )
2024-12-02 13:30:26 +03:00
Dmitry Stogov
5ed438fe07
Update IR
...
IR commit: 673308a039eed5a2fdf4a2783b3dd3d6010a8c19
2024-11-29 16:28:27 +03:00
Dmitry Stogov
6fca900cc7
Update IR
...
IR commit: 7c26e26126123beac8dbaf811d5eac8d789d584f
2024-11-29 02:39:33 +03:00
Dmitry Stogov
b89d7ff92a
Fix GH-16821: runtime error: member access within misaligned address when running phpseclib tests ( #16951 )
2024-11-27 00:43:45 +03:00
Niels Dossche
ed556939df
Extract call_level conditions out to separate functions ( #16949 )
...
These are repeated a couple of times, so centralise it in 2 functions to
reduce repetition and make updating this less error-prone.
2024-11-26 21:22:12 +01:00
Dmitry Stogov
d31de85f5f
Avoid possible spill conflict (one of the problem that caused GH-16821) ( #16947 )
2024-11-26 21:44:15 +03:00
Niels Dossche
de30ba5042
Fix GH-16879: JIT dead code skipping does not update call_level
...
We intend to execute `MATCH_ERROR` in the VM and return to trace a hot
function in BB1. We generate a tail handler and skip all remaining
oplines of BB0. That means the `INIT_FCALL` in BB0 is missed and
`call_level` is not increased to 1. This leads to the assertion
failure.
This patch fixes the issue by updating the `call_level` for the skipped
oplines.
Closes GH-16939.
2024-11-26 19:27:17 +01:00
Dmitry Stogov
7892a0ec8a
Fix GH-16913: 8.4 function JIT memory corruption ( #16943 )
...
with '#' will be ignored, and an empty message aborts the commit.
2024-11-26 16:59:57 +03:00
Niels Dossche
f4ca6d2794
Fix GH-16902: Set of opcache tests fail zts+aarch64 (8.4+)
...
Accompanying IR PR: https://github.com/dstogov/ir/pull/95
Closes GH-16924.
2024-11-25 19:51:01 +01:00
Dmitry Stogov
ba8e3e1d79
Update IR
...
IR commit: ff7ee6c1e6090ba0ba7b47cb77939518304fab6b
2024-11-25 10:29:41 +03:00
Christoph M. Becker
da81b5c8d2
Reapply "Merge branch 'PHP-8.3' into PHP-8.4"
...
This reverts commit 83ca37483c , and
fixes the previous bad merge.
2024-11-20 23:24:43 +01:00
Christoph M. Becker
83ca37483c
Revert "Merge branch 'PHP-8.3' into PHP-8.4"
...
This reverts commit ae62779386 , reversing
changes made to 19e685ecc4 .
This was a bad merge; I'll have a look shortly.
2024-11-20 19:45:36 +01:00
Christoph M. Becker
ae62779386
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-16851: JIT_G(enabled) not set correctly on other threads
2024-11-20 19:14:57 +01:00
Christoph M. Becker
58ed759ba7
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix GH-16851: JIT_G(enabled) not set correctly on other threads
2024-11-20 19:12:40 +01:00
Dylan K. Taylor
ff3b4eca0e
Fix GH-16851: JIT_G(enabled) not set correctly on other threads
...
There doesn't seem to be a thread post-startup hook that runs after
zend_startup_cb() that could be used for this
this fix is similar to accel_startup_ok() as seen here: https://github.com/php/php-src/blob/fc1db70f106525e81f9a24539340b7cf2e82e844/ext/opcache/ZendAccelerator.c#L2631-L2634
Closes GH-16853.
2024-11-20 19:11:44 +01:00
Dmitry Stogov
d0c336a666
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Use the immutable twin of temporary op_array (#16861 )
2024-11-19 20:55:40 +03:00
Dmitry Stogov
d1a9281814
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Use the immutable twin of temporary op_array (#16861 )
2024-11-19 20:55:32 +03:00
Dmitry Stogov
ef5844a1ca
Use the immutable twin of temporary op_array ( #16861 )
2024-11-19 20:55:15 +03:00
Dmitry Stogov
c6c3d9fa5a
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Backport JIT fix: set valid EX(opline) before calling gc_possible_root() (#16858 )
2024-11-19 18:04:15 +03:00
Dmitry Stogov
6167c64782
Backport JIT fix: set valid EX(opline) before calling gc_possible_root() ( #16858 )
2024-11-19 18:03:54 +03:00
Dmitry Stogov
997431dea2
JIT: Set valid EX(opline) before calling gc_possible_root()
2024-11-18 19:31:26 +03:00
Dmitry Stogov
e55bf9a2ea
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-16829: Segmentation fault with opcache.jit=tracing enabled on aarch64
2024-11-18 14:34:55 +03:00
Dmitry Stogov
5575703fb3
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix GH-16829: Segmentation fault with opcache.jit=tracing enabled on aarch64
2024-11-18 14:34:42 +03:00
Dmitry Stogov
79aaeeafe5
Fix GH-16829: Segmentation fault with opcache.jit=tracing enabled on aarch64
2024-11-18 14:27:08 +03:00
Niels Dossche
4767c0626c
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-16770: Tracing JIT type mismatch when returning UNDEF
2024-11-14 22:34:12 +01:00
Niels Dossche
0bf74bf9d8
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix GH-16770: Tracing JIT type mismatch when returning UNDEF
2024-11-14 22:34:05 +01:00
Niels Dossche
cbb3b9371d
Fix GH-16770: Tracing JIT type mismatch when returning UNDEF
...
When returning an UNDEF value, it actually becomes NULL.
The following code took this into account:
https://github.com/php/php-src/blob/28344e0445bc2abae8dc5f1376aa0ff350e6d66d/ext/opcache/jit/zend_jit_trace.c#L2196-L2199
But the stack does not update the type to NULL, causing a mismatch.
Closes GH-16784.
Co-authored-by: Dmitry Stogov <dmitry@zend.com >
2024-11-14 22:33:06 +01:00
Dmitry Stogov
f6256fa2c0
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix incorrect handling of ZEND_ACC_FINAL flag in JIT (#16778 )
2024-11-13 14:43:43 +03:00
Dmitry Stogov
b9c6f07713
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix incorrect handling of ZEND_ACC_FINAL flag in JIT (#16778 )
2024-11-13 14:39:18 +03:00
Dmitry Stogov
19809a526b
Fix incorrect handling of ZEND_ACC_FINAL flag in JIT ( #16778 )
2024-11-13 14:38:54 +03:00
Dmitry Stogov
56381e8f1d
Update IR
...
IR commit: 23c188cff0594d3af23517537e74e9e3b9b7f120
2024-11-05 17:52:37 +03:00
Niels Dossche
38e1b0ac8c
Fix GH-16572: Incorrect result with reflection in low-trigger JIT
...
When a recursive call happens with invalid arguments, the maximum valid
arguments are computed and stored in `num_args`, but the RECV entry
block we jump to is `call_num_args` instead. This can skip argument
validation checks. Fix this by using `num_args` instead.
Closes GH-16575.
2024-10-28 19:31:52 +01:00
Dmitry Stogov
cfd954f5f9
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-16499: [JIT] Undefined to null coercion issues for return
2024-10-21 14:51:41 +03:00
Dmitry Stogov
920e3d6b70
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix GH-16499: [JIT] Undefined to null coercion issues for return
2024-10-21 14:51:31 +03:00
Dmitry Stogov
fe513655dc
Fix GH-16499: [JIT] Undefined to null coercion issues for return
2024-10-21 14:50:50 +03:00
Dmitry Stogov
8b5668efef
Fix invalid target opline with jit->reuse_ip active ( #16457 )
...
This is an alternative for #16440
2024-10-18 12:48:23 +03:00
Dmitry Stogov
6896756929
Update IR
...
IR commit: abbdbf2ad7f66b02106f3b51602a21f10f508808
2024-10-17 17:31:47 +03:00
Dmitry Stogov
f68dcc5a1c
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-16393: Assertion failure in ext/opcache/jit/zend_jit.c:2897
2024-10-15 12:03:36 +03:00
Dmitry Stogov
dd45d85531
Merge branch 'PHP-8.2' into PHP-8.3
...
* PHP-8.2:
Fix GH-16393: Assertion failure in ext/opcache/jit/zend_jit.c:2897
2024-10-15 12:01:40 +03:00
Dmitry Stogov
bf786d0d28
Fix GH-16393: Assertion failure in ext/opcache/jit/zend_jit.c:2897
2024-10-15 12:00:59 +03:00