Commit graph

139723 commits

Author SHA1 Message Date
Niels Dossche
1e94f3423b
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Split off php_set_sock_blocking() and s.is_blocked to a separate function
  Fix missing checks against php_set_blocking() in xp_ssl.c
2025-05-20 08:08:39 +02:00
Niels Dossche
1863014fbd
Split off php_set_sock_blocking() and s.is_blocked to a separate function
This makes it harder to forget the check and keeps the variable and
function call consistent.

Closes GH-18604.
2025-05-20 08:08:06 +02:00
Niels Dossche
31ebb42268
Fix missing checks against php_set_blocking() in xp_ssl.c 2025-05-20 08:07:34 +02:00
Niels Dossche
b14250a677
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Backport accel_globals->key leak fix (8.3)
2025-05-19 22:28:06 +02:00
Niels Dossche
b2d78ae00c
Backport accel_globals->key leak fix (8.3)
Closes GH-18602.
2025-05-19 22:27:54 +02:00
Niels Dossche
db3bf715e0
Fix leak of accel_globals->key
I don't know why this was guarded with ZTS, but it leaks on this test
(and a few more):
`./sapi/cli/php ./run-tests.php -c . --show-diff sapi/phpdbg/tests/stdin_001.phpt`

Closes GH-18593.
2025-05-19 19:34:16 +02:00
Niels Dossche
6b795f64a5
Fix GH-18534: FPM exit code 70 with enabled opcache and hooked properties in traits
The trait handling for property hooks in preloading did not exist, we
add a check to skip trait clones and we add the necessary code to update
the op arrays.

Closes GH-18586.
2025-05-19 19:21:53 +02:00
Niels Dossche
43915b302c
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18567: Preloading with internal class alias triggers assertion failure
2025-05-19 19:20:11 +02:00
Niels Dossche
41e11a627d
Fix GH-18567: Preloading with internal class alias triggers assertion failure
The assertion is imprecise now, and the code assumed that from the
moment an internal class was encountered that there were only internal
classes remaining. This is wrong now, and we still have to continue if
we encounter an internal class. We can only skip the remaining iterations
if the entry in the hash table is not an alias.

Closes GH-18575.
2025-05-19 19:19:26 +02:00
Niels Dossche
9bf140afb4
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix deprecation warning for libxml SAX header (#18594)
2025-05-19 19:11:22 +02:00
Niels Dossche
92a0cc7d94
Fix deprecation warning for libxml SAX header (#18594)
This header is deprecated, but fortunately it isn't actually used.
2025-05-19 19:10:27 +02:00
Niels Dossche
08cba2dcc1
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix OSS-Fuzz #418106144
  Fix OSS-Fuzz #417078295
2025-05-19 19:07:17 +02:00
Niels Dossche
98cb17f4fd
Fix OSS-Fuzz #418106144
The VM assumes that an exception must be handled when the AST evaluation
returns FAILURE. However, the comparison functions always return SUCCESS
even if an exception happened. This can be fixed in
zend_ast_evaluate_inner() or we can make is_smaller_function() etc check
for the exception. I chose the former to avoid impact or API breaks.
Perhaps in the future the comparison functions should either return void
or return whether an exception happened, as to be not misleading.

Closes GH-18589.
2025-05-19 19:05:32 +02:00
Niels Dossche
46ac878f6a
Fix OSS-Fuzz #417078295
If the variable_ptr and fetched value are the same or overlap, then we
get a UAF. Prevent this by delaying destruction.

Closes GH-18588.
2025-05-19 19:04:58 +02:00
Levi Morrison
59e6165fa6
Merge branch 'PHP-8.3' into PHP-8.4 2025-05-19 09:53:15 -06:00
Levi Morrison
35455b17be
fix: dangling opline in ZEND_INIT_ARRAY (#18578)
This causes problems if an allocation profiler decides to walk the
stack, or if the engine itself OOMs on this opcode, and it tries to
print file and line information.
2025-05-19 09:45:28 -06:00
David Carlier
68abc19229
Follow-up on GH-18577, adjust new test due to change on nested objects. 2025-05-17 12:46:27 +01:00
David Carlier
e4e71215d6
Merge branch 'PHP-8.3' into PHP-8.4 2025-05-17 12:45:13 +01:00
David Carlier
88d6e7c238
fix regex typo for GH-18577 new test 2025-05-17 12:44:57 +01:00
David Carlier
a7884250b1
Merge branch 'PHP-8.3' into PHP-8.4 2025-05-17 11:20:39 +01:00
David Carlier
4dcbd24bad
GH-18572: infinite stack recursion in fallback object comparison.
With nested objects and recursive comparisons, it is for now unavoidable
to have a stack overflow we do some early damage control attempt early
on with zend.max_allowed_stack_size check but ultimately more a band-aid
than a definitive solution.

close GH-18577
2025-05-17 11:20:16 +01:00
Niels Dossche
dbc7c5f34a
Backport lexbor/lexbor@814e0bce97 (#18574)
Co-authored-by: Alexander Borisov <lex.borisov@gmail.com>
2025-05-16 20:27:56 +02:00
George Wang
72efe6dcdf Merge branch 'PHP-8.3' into PHP-8.4 2025-05-15 11:53:07 -04:00
George Wang
8e5b3129de Address compiler warnings. 2025-05-15 11:52:49 -04:00
Remi Collet
73321e22d2
NEWS 2025-05-15 09:22:41 +02:00
Remi Collet
8647624261
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  NEWS
  Fix GH-18529: ldap no longer respects TLS_CACERT from ldaprc in ldap_start_tls() Regresion introduced in fix for GH-17776
2025-05-15 09:22:09 +02:00
Remi Collet
8da9530652
NEWS 2025-05-15 09:21:58 +02:00
Remi Collet
2760a3ef97
Fix GH-18529: ldap no longer respects TLS_CACERT from ldaprc in ldap_start_tls() Regresion introduced in fix for GH-17776
- ensure TLS string options are properly inherited
  workaround to openldap issue https://bugs.openldap.org/show_bug.cgi?id=10337

- fix ldaps/start_tls tests using LDAPNOINIT in ldaps/tls tests
2025-05-15 09:19:57 +02:00
Arnaud Le Blanc
18276a8b42
Snapshotted poly_func / poly_this may be spilled
Polymorphic calls pass this and the function to side traces via snapshotting.
However, we assume that this/func are in registers, when in fact they may be
spilled.

Here I update snapshotting of poly_func/poly_this to support spilling:

 - In zend_jit_snapshot_handler, keep track of the C stack offset
   of the spilled register, in a way similar to how stack variables.
 - In zend_jit_start, do not pre-load the registers if they were spilled.
 - In zend_jit_trace_exit / zend_jit_trace_deoptimization, load from the
   stack if the register was spilled.
 - Store a reference to poly_func/poly_this in zend_jit_ctx so we can use that
   directly in the side trace.

Closes GH-18408
2025-05-14 12:27:57 +02:00
Tim Düsterhus
40edd58d36
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  standard: Take `zend.assertions` into account for dynamic calls to `assert()` (#18521)
2025-05-12 08:45:26 +02:00
Tim Düsterhus
8d2682fc50
standard: Take zend.assertions into account for dynamic calls to assert() (#18521)
Fixes php/php-src#18509.
2025-05-12 08:44:46 +02:00
Tim Düsterhus
84f82d0a1c
gen_stub: Fix ce_flags generation for compatibility mode (#18507)
* gen_stub: Fix `ce_flags` generation for compatibility mode

Fixes php/php-src#18506

* gen_stub: Improve output for ce_flags compatibility
2025-05-09 13:33:09 +02:00
Remi Collet
71ffa9596a
bump zip extension version to 1.22.6 2025-05-07 14:24:07 +02:00
Niels Dossche
11ad09e4bf
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Sync EXTENSIONS and extend maintenance time
2025-05-06 22:07:05 +02:00
Niels Dossche
e7a44a68e9
Sync EXTENSIONS and extend maintenance time 2025-05-06 22:06:31 +02:00
Ilija Tovilo
14ff4b75a2
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix missing include in win32/globals.c
2025-05-06 15:52:30 +02:00
Ilija Tovilo
69f0882d3b
Fix missing include in win32/globals.c
This previously errored with:

win32\globals.c(66): error C2220: the following warning is treated as an error
win32\globals.c(66): warning C4013: 'php_win32_signal_ctrl_handler_request_shutdown' undefined; assuming extern returning int

This only errors on master because of 2473f57ba (thanks to Niels for
that info!).

Closes GH-18508
2025-05-06 15:51:37 +02:00
Niels Dossche
5825a6be83
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18494: PDO OCI segfault in statement GC
2025-05-05 19:30:42 +02:00
Niels Dossche
dcf9d8f812
Fix GH-18494: PDO OCI segfault in statement GC
This is the same issue that was fixed in 2ae897fff7, but now for OCI.

Closes GH-18495.
2025-05-05 19:30:23 +02:00
Niels Dossche
d4a3e437ae
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix leak+crash with sapi_windows_set_ctrl_handler()
2025-05-05 19:14:13 +02:00
Niels Dossche
fb3536fd60
Fix leak+crash with sapi_windows_set_ctrl_handler()
The ctrl_handler is never destroyed. We have to destroy it at request
end so we avoid leaking it and also avoid keeping a reference to
previous request memory in a next request. The latter can result in a
crash and can be demonstrated with this script and `--repeat 2`:

```php
class Test {
	public function set() {
		sapi_windows_set_ctrl_handler(self::cb(...));
	}
	public function cb() {
	}
}

$test = new Test;
$test->set();
sleep(3);
```
When you hit CTRL+C in the second request you can crash.

This patch resolves both the leak and crash by destroying the
ctrl_handler after a request.

Closes GH-18231.
2025-05-05 19:13:39 +02:00
David Carlier
2e2077172d
Merge branch 'PHP-8.3' into PHP-8.4 2025-05-04 14:15:05 +01:00
David Carlier
8a585856d1
Fix GH-18480: array_splice overflow on array length with offset.
close GH-18483
2025-05-04 14:14:22 +01:00
Niels Dossche
42ad1c64bf
Backport lexbor/lexbor#274
Co-authored-by: Alex Peattie <alexpeattie@gmail.com>

Closes GH-18490.
2025-05-04 12:57:54 +02:00
David Carlier
a7b78a5091
Fix ext/date: date_sunrise() new tests.
close GH-18489
2025-05-03 19:40:16 +01:00
David Carlier
004d7cd290
Merge branch 'PHP-8.3' into PHP-8.4 2025-05-03 16:56:32 +01:00
David Carlier
0227d96f48
Fix GH-18481: date_sunrise check sun rise with offset if is finite/is nan
close GH-18484
2025-05-03 16:56:09 +01:00
David Carlier
351face053
Merge branch 'PHP-8.3' into PHP-8.4 2025-05-02 21:32:20 +01:00
David Carlier
24ab0f1ea1
Fixed GH-18458: Authorization set with CURLOPT_USERPWD with NULL value.
Close GH-18460
2025-05-02 21:31:50 +01:00
Niels Dossche
8d6e377ed8
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Update NEWS for the intl reference fixes
  Fix reference handling of IntlTimeZone::getCanonicalID/intltz_get_canonical_id
  Fix reference handling of grapheme_extract()
  Fix numfmt_parse_currency() reference handling
2025-05-01 10:42:25 +02:00