1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Commit Graph

2283 Commits

Author SHA1 Message Date
Dmitry Stogov 4c84ed4d98 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-01-15 02:46:08 +03:00
Dmitry Stogov 9aaa469f99 Update IR
IR commit: d6d7fc489137aab218b04b59d770b497c5ae3832
2025-01-15 02:45:24 +03:00
Niels Dossche 650e59a1c2 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17428: Assertion failure ext/opcache/jit/zend_jit_ir.c:8940
2025-01-14 22:38:18 +01:00
Niels Dossche 3524702fe1 Fix GH-17428: Assertion failure ext/opcache/jit/zend_jit_ir.c:8940
The code to update the call_level in that case skips the opline itself,
as that's handled by the tail handler, and then wants to set the opline
to the last opline of the block because the code below the switch will
update the call_level for that opline.
However, the test has a block with a single opline (THROW). The block
after that has ZEND_INIT_FCALL, because `i` points to ZEND_INIT_FCALL
now, it erroneously causes the call_level after the switch.

Closes GH-17438.
2025-01-14 22:37:41 +01:00
Christoph M. Becker 1675d32261 Fix printf style issues in Windows specific code (GH-17452)
A couple of calls pass strings as formats (`-Wformat-security`), and
some others mix up types (`-Wformat`).
2025-01-13 11:50:05 +01:00
Dmitry Stogov 2d4155a6a9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-01-10 00:35:33 +03:00
Dmitry Stogov 4763193567 Update IR
IR commit: e445f57f3a936584db28489a49098d52f03388a7
2025-01-10 00:34:58 +03:00
Niels Dossche 8c443016e9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17307: Internal closure causes JIT failure
  Generate inline frameless icall handlers only if the optimization level is set to inline
  Fix GH-15981: Segfault with frameless jumps and minimal JIT
  Fix GH-15833: Segmentation fault (access null pointer) in ext/spl/spl_array.c
2025-01-09 20:01:16 +01:00
Niels Dossche 28b448ac20 Fix GH-17307: Internal closure causes JIT failure
`bcadd(...)` is a closure for an internal function, and
`zend_jit_push_call_frame` takes into account both last_var and the
difference in argument numbers not only for user code but also for
internal code. However, this is inconsistent with
`zend_vm_calc_used_stack`, causing argument corruption.
Making this consistent fixes the issue.

I could only reproduce the assertion failure when using Valgrind.

Closes GH-17319.
2025-01-09 19:59:38 +01:00
Niels Dossche c790c5b2e7 Generate inline frameless icall handlers only if the optimization level is set to inline 2025-01-09 19:59:10 +01:00
Niels Dossche 72184abd2f Fix GH-15981: Segfault with frameless jumps and minimal JIT
Minimal JIT shouldn't generate a call to the complex handler, but
instead rely on the VM and then check for a two-way jump.
This moves the frameless codegen under the check `JIT_G(opt_level) >=
ZEND_JIT_LEVEL_INLINE`.
2025-01-09 19:59:03 +01:00
Niels Dossche 466c8b0e03 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17257: UBSAN warning in ext/opcache/jit/zend_jit_vm_helpers.c
  Fix GH-17223: Memory leak in libxml encoding handling
2024-12-26 12:26:59 +01:00
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
Niels Dossche b4c5f4e92d Remove unused dummy_op_array (#17272)
This was introduced in b0b43e86ae for register allocation code, but is
not used anymore nowadays.
2024-12-26 11:25:41 +01:00
Dmitry Stogov ac2b656a13 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17190: Assertion failure ext/opcache/jit/ir/ir_gcm.c (#17221)
2024-12-20 11:02:41 +03: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 6a015491a0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2024-12-19 20:30:05 +03:00
Dmitry Stogov 33c12e0776 Update IR
IR commit: 79483000c2a4b918221fa3097ca47b48b3519447
2024-12-19 20:29:35 +03:00
Ilija Tovilo 8aac6987c2 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix RC inference of op1 of FETCH_OBJ and INIT_METHOD_CALL
  Add tests for GH-17151
2024-12-18 19:10:00 +01: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 fadceca448 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17140 (Assertion failure in JIT trace exit with ZEND_FETCH_DIM_FUNC_ARG)
  Fix GH-16255: Unexpected nan value in ext/gd/libgd/gd_filter.c
2024-12-16 19:46:21 +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 c630801ae7 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-15709: Crashing tests on Windows x64  (#17095)
2024-12-13 02:06:14 +03: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 7717df2c93 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-9011: Assertion failure with tracing JIT (#17042)
2024-12-04 19:51:39 +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 a768a54e18 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16996: 8.4 tracing JIT phpseclib failures (#17030)
2024-12-03 20:43:26 +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 0949e7acc7 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17003: Pecl 8.4 tracing JIT crash (#17032)
2024-12-03 20:43:02 +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 bcb7f9b018 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2024-12-03 13:01:54 +03:00
Dmitry Stogov f04a9f466f Update IR
IR commit: 1a41bddcf0a41b9a3866d00b57591b3684c88443
2024-12-03 13:01:31 +03:00
Dmitry Stogov 7c4ed6a423 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16984: function JIT overflow bug (#17015)
2024-12-02 13:30:45 +03:00
Dmitry Stogov 03bb112fb2 Fix GH-16984: function JIT overflow bug (#17015) 2024-12-02 13:30:26 +03:00
Dmitry Stogov e8154c6c7d Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2024-11-29 16:28:53 +03:00
Dmitry Stogov 5ed438fe07 Update IR
IR commit: 673308a039eed5a2fdf4a2783b3dd3d6010a8c19
2024-11-29 16:28:27 +03:00
Dmitry Stogov 5c05e6c247 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2024-11-29 02:40:52 +03:00
Dmitry Stogov 6fca900cc7 Update IR
IR commit: 7c26e26126123beac8dbaf811d5eac8d789d584f
2024-11-29 02:39:33 +03:00
Dmitry Stogov 2de0d8ebbe Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16821: runtime error: member access within misaligned address when running phpseclib tests (#16951)
2024-11-27 00:44:03 +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 30ec2de83f Merge branch 'PHP-8.4'
* PHP-8.4:
  Extract call_level conditions out to separate functions (#16949)
2024-11-26 21:23:59 +01: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 be27cbdc4a Merge branch 'PHP-8.4'
* PHP-8.4:
  Avoid possible spill conflict (one of the problem that caused GH-16821) (#16947)
2024-11-26 21:44:32 +03: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 b3db7f7a9c Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16879: JIT dead code skipping does not update call_level
2024-11-26 19:27:29 +01: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 7b17313a7d Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16913: 8.4 function JIT memory corruption (#16943)
2024-11-26 17:00:16 +03: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 aa05c827e2 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16902: Set of opcache tests fail zts+aarch64 (8.4+)
  Fix GH-16902: Set of opcache tests fail zts+aarch64 (8.2-8.3)
2024-11-25 19:51:13 +01: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