Commit Graph

138325 Commits

Author SHA1 Message Date
Christoph M. Becker
e3bcbb26b6
Merge branch 'PHP-8.4'
* PHP-8.4:
  Declare zend_call_stack_size_error() as ZEND_API
2024-10-03 22:47:26 +02:00
Christoph M. Becker
6f7f32c330
Declare zend_call_stack_size_error() as ZEND_API
This is necessary at least on Windows to be able to actually call the
function from a different module (in this case php8phpdbg.dll could not
be build).

Closes GH-16204.
2024-10-03 22:46:53 +02:00
Niels Dossche
0624eb4118
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16184: UBSan address overflowed in ext/pcre/php_pcre.c
2024-10-03 21:13:13 +02:00
Niels Dossche
5839fc5dd9
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16184: UBSan address overflowed in ext/pcre/php_pcre.c
2024-10-03 21:12:42 +02:00
Niels Dossche
ddc7a6b1fc
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16184: UBSan address overflowed in ext/pcre/php_pcre.c
2024-10-03 21:11:25 +02:00
Niels Dossche
c4bb07552e
Fix GH-16184: UBSan address overflowed in ext/pcre/php_pcre.c
libpcre2 can return the special value -1 for a non-match.
In this case we get pointer overflow, although it doesn't matter in
practice because the pointer will be in bounds and the copy length will
be 0. Still, we should fix the UBSAN warning.

Closes GH-16205.
2024-10-03 21:10:57 +02:00
David CARLIER
dbcc77d0c2
Fix GH-15893: Pdo\Pgsql backport fixes from GH-16124 (#16158) 2024-10-03 19:25:39 +01:00
Niels Dossche
8a6de2ca14
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix bugs GH-16150 and GH-16152: intern document mismanagement
2024-10-03 19:33:15 +02:00
Niels Dossche
ba0834bc2c
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix bugs GH-16150 and GH-16152: intern document mismanagement
2024-10-03 19:33:09 +02:00
Niels Dossche
d4a4d2e7a9
Fix bugs GH-16150 and GH-16152: intern document mismanagement
The reference counts of the internal document pointer are mismanaged.
In the case of fragments the refcount may be increased too much, while
for other cases the document reference may not be applied to all
children.

This bug existed for a long time and this doesn't reproduce (easily)
on 8.2 due to other bugs. Furthermore 8.2 will enter security mode soon,
and this change may be too risky.

Fixes GH-16150.
Fixed GH-16152.
Closes GH-16178.
2024-10-03 19:28:50 +02:00
Niels Dossche
807a74a7ac
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16190: Using reflection to call Dom\Node::__construct causes assertion failure
2024-10-03 19:26:14 +02:00
Niels Dossche
3be6ff66b8
Fix GH-16190: Using reflection to call Dom\Node::__construct causes assertion failure
Closes GH-16193.
2024-10-03 19:25:58 +02:00
Gina Peter Banyard
2609127acb
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] UPGRADING: Move more stuff to the correct place
2024-10-03 17:50:40 +01:00
Gina Peter Banyard
96ae694a4f
[skip ci] UPGRADING: Move more stuff to the correct place
Closes GH-16201
2024-10-03 17:50:21 +01:00
Christoph M. Becker
850a5a49ee
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16199: GREP_HEADER() is broken
2024-10-03 18:33:37 +02:00
Peter Kokot
e915ed75ea
Fix GH-16199: GREP_HEADER() is broken
This also fixes the libxml version check when the libxml/xmlversion.h
is located elsewhere than libxml2 include directory.

Closes GH-15619.
2024-10-03 18:33:17 +02:00
Christoph M. Becker
d7f09eb0ed
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Fix UPGRADING entries (#16176)
2024-10-03 18:32:33 +02:00
Gina Peter Banyard
50dfc436cd
[skip ci] Fix UPGRADING entries (#16176)
* [skip ci] Fix UPGRADING entries

* [skip ci] Add DBA new class
2024-10-03 16:14:33 +01:00
Arnaud Le Blanc
2d8a93cbb6
Merge branch 'PHP-8.4'
* PHP-8.4:
  [ci skip] NEWS for GH-16055
  Support stack limit in phpdbg SAPI
2024-10-03 15:25:57 +02:00
Arnaud Le Blanc
7c31e5f9e6
[ci skip] NEWS for GH-16055 2024-10-03 15:25:29 +02:00
Arnaud Le Blanc
443aa29dbe
Support stack limit in phpdbg SAPI
Fixes GH-16041
Closes GH-16055
2024-10-03 15:22:51 +02:00
Arnaud Le Blanc
8b41bca615
Merge branch 'PHP-8.4'
* PHP-8.4:
  [ci skip] NEWS for GH-15960
  Deny resetting an object as lazy during property iteration
  Ensure to initialize lazy object in foreach
  Do not null out obj->properties when resetting object
  Fix handling of undef property during foreach by ref on hooked class
2024-10-03 15:14:08 +02:00
Arnaud Le Blanc
e02e6be633
[ci skip] NEWS for GH-15960 2024-10-03 15:13:42 +02:00
Arnaud Le Blanc
c9dfb77446
Deny resetting an object as lazy during property iteration
Supporting object reset while its properties are being iterated would increase
complexity for little benefit. Furthermore it may not be possible to ensure a
consistent behavior between ghosts and proxies (wrt to iteration position).

Iteration is detected by checking if the object's properties ht has iterators.
This requires refactoring the hooked get_iterator() implementation to ensure
that it creates a properties ht iterator immediately.

Closes GH-15960
2024-10-03 15:12:21 +02:00
Arnaud Le Blanc
3151117987
Ensure to initialize lazy object in foreach
foreach() by-passes the get_properties() handler and did not always trigger
initialization.
2024-10-03 15:12:21 +02:00
Arnaud Le Blanc
52fec6958c
Do not null out obj->properties when resetting object
Engine expects the properties ht to be separated, assigned a new ht, or resized,
but never to be nulled.
2024-10-03 15:12:21 +02:00
Arnaud Le Blanc
4d7fcea5da
Fix handling of undef property during foreach by ref on hooked class 2024-10-03 15:12:21 +02:00
Christoph M. Becker
57c4b941b7
Always exclude dl_test from test php.ini (GH-16098)
The dl_test extension is not supposed to be loaded via php.ini
settings, so we exclude it from the typical case on Windows where
`--enable-test-ini` is enabled by `--enable-snapshot-build`.
2024-10-03 14:35:12 +02:00
David Carlier
95fa39dce8
Merge branch 'PHP-8.4' 2024-10-03 12:49:42 +01:00
David Carlier
f5d4781ee0
Merge branch 'PHP-8.3' into PHP-8.4 2024-10-03 12:48:46 +01:00
David Carlier
1aeb70f83c
Merge branch 'PHP-8.2' into PHP-8.3 2024-10-03 12:48:34 +01:00
David Carlier
f453d1ae2a
Fix GH-16189: underflow on preg_match/preg_match_all start_offset.
close GH-16191
2024-10-03 12:48:13 +01:00
Christoph M. Becker
3e9f2fa071
Avoid dl() in run-tests.php (GH-16126)
Prior to running the tests, the test runner checks for all generally
available extensions; it does this by scanning the `extension_dir` for
files matching the typical extension pattern, but verifies that the
file is actually a PHP extension by calling `dl()`.  However, `dl()`
has known issues[1].  On Windows CI we always get an ugly "zend_mm_heap
corrupted" message, and we even can't `dl()` ext/mysql when OPcache is
enabled[2].  So we better avoid the double-check with `dl()`, which is
unlikely to be necessary anyway.

[1] <https://github.com/php/php-src/issues/9196>
[2] <https://github.com/php/php-src/issues/8508>
2024-10-03 12:58:27 +02:00
Christoph M. Becker
fbfc89944d
x86 builds on Windows are warning level 1 clean (GH-16170)
The only issue that was left was due to the old build of net-snmp 5.7.3; since updating to net-snmp 5.9.4, this is resolved.

The patch has originally been provided by @mvorisek.
2024-10-03 12:55:42 +02:00
Christoph M. Becker
2f09c0ed0f
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16181: phpdbg: exit in exception handler reports fatal error
2024-10-03 11:39:34 +02:00
Christoph M. Becker
3c1af3febb
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16181: phpdbg: exit in exception handler reports fatal error
2024-10-03 11:39:03 +02:00
Christoph M. Becker
95c97c81b7
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16181: phpdbg: exit in exception handler reports fatal error
2024-10-03 11:37:15 +02:00
Christoph M. Becker
f14e5cfaaa
Fix GH-16181: phpdbg: exit in exception handler reports fatal error
When running PHP code, we must not handle `UnwindExit` exceptions, but
rather have to ignore them.

Closes GH-16182.
2024-10-03 11:36:13 +02:00
Niels Dossche
c77a1291d6
Don't use recursion when transferring a DOM internal document pointer (#16180)
Recursion is typically slower than iteration, and furthermore, this can
cause problems in theory with deep trees.
2024-10-03 07:56:12 +02:00
DanielEScherzer
8b8a6733d1
ext/reflection: fix some typos [skip ci] (#16183) 2024-10-03 07:55:25 +02:00
Gina Peter Banyard
524f6dfb19 ext/ldap: Use zend_string_equals() API 2024-10-02 23:22:34 +01:00
Gina Peter Banyard
355f320a27 ext/ldap: Use HashTable* for controls 2024-10-02 23:22:34 +01:00
Niels Dossche
a165f1fffc
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-15169: stack overflow when var serialization in ext/standard/var
2024-10-02 21:32:50 +02:00
Niels Dossche
577eb68212
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-15169: stack overflow when var serialization in ext/standard/var
2024-10-02 21:32:20 +02:00
Niels Dossche
bd724bdf42
Fix GH-15169: stack overflow when var serialization in ext/standard/var
Adding a stack check here as I consider serialization to be a more
sensitive place where erroring out with an exception seems appropriate.

Closes GH-16159.
2024-10-02 21:30:59 +02:00
Dmitry Stogov
3f913c123a
Implement JIT for ZEND_FETCH_STATIC_PROP_* and improve interpretation (#16157)
* Implement JIT for ZEND_FETCH_STATIC_PROP_* and improve interpretation

* Revert incorrect change

* Use FASTCALL calling convention

* Use EMPTY_SWITCH_DEFAULT_CASE

* Move the loading of the property info into zend_jit_uninit_static_prop()
2024-10-02 21:02:33 +03:00
Dmitry Stogov
83bbf4b339
Merge branch 'PHP-8.4'
* PHP-8.4:
  Improve JIT TRACE coverage (#16171)
2024-10-02 19:27:52 +03:00
Dmitry Stogov
ddc49153f1
Improve JIT TRACE coverage (#16171)
Now it's possible that PHP tracing JIT loses some parts of the "hot"
code. In case we have a root LOOP trace with an inlined call of some
function, and we get a SIDE exit inside that function - we recorded a
side trace, but finished it a the RETURN of the inlined function. As
result the opcodes betwee RETURN from SIDE trace and LOOP exit were not
covered by tracer and were executed in interpreter.

This patch introduces a "ret_depth" argument that prevents stopping
tracing on RETURN of such SIDE trace.
2024-10-02 19:27:31 +03:00
Gina Peter Banyard
d7bdf902e5
ext/phar: Remove phar_resolve_alias() (#15860)
As this is unused and a SourceGraph search returns 0 result
2024-10-02 15:44:05 +01:00
Arnaud Le Blanc
e504df830c
Merge branch 'PHP-8.4'
* PHP-8.4:
  [ci skip] NEWS for GH-16061
  Fix array_merge_recursive(): convert_to_array() may need separation (#16061)
2024-10-02 12:44:10 +02:00