Commit graph

130758 commits

Author SHA1 Message Date
Ilija Tovilo
8340d75d17
Endless recursion when using + on array in foreach
This reverts commit 84b4020eb4.

Fixes GH-11171
2023-05-01 09:21:04 -04:00
Patrick Allaert
c598a92d54
Merge branch 'PHP-8.1' into PHP-8.2 2023-04-25 16:18:44 +02:00
Patrick Allaert
725f136f9a
PHP-8.1 is now for PHP 8.1.20-dev 2023-04-25 16:18:30 +02:00
nielsdos
7300659391 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Set error_log to an empty value if the test relies on that feature
2023-04-24 23:23:45 +02:00
Niels Dossche
691ff9f845 Set error_log to an empty value if the test relies on that feature
Some tests fail if the error_log is overriden by the loaded ini
configuration. Explicitly set it to an empty value to prevent the
failures.
See https://github.com/php/php-src/issues/10737#issuecomment-1452899299

Closes GH-10772.
2023-04-24 23:19:15 +02:00
Derick Rethans
629d7740e8 Import timelib 2022.07 to address OSS fuzz issue 2023-04-21 11:29:56 +01:00
Ilija Tovilo
439919c91d
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect CG(memoize_mode) state after bailout in ??=
2023-04-20 19:46:05 +02:00
Ilija Tovilo
4c38a79f09
Fix incorrect CG(memoize_mode) state after bailout in ??=
Fixes GH-11108
Closes GH-11109
2023-04-20 19:45:02 +02:00
Ilija Tovilo
b2282bee32
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix reference returned from CallbackFilterIterator::accept()
2023-04-20 13:43:20 +02:00
Ilija Tovilo
5855bdcd6c
Fix reference returned from CallbackFilterIterator::accept()
Fixes oss-fuzz #58181
2023-04-20 10:18:18 +02:00
Christopher Jones
05467b93c7
Merge branch 'pecloci8' into PHP-8.2
* pecloci8:
  Bump OCI8 version to make a PECL release for 8.2
2023-04-20 18:04:32 +10:00
Christopher Jones
91d3aaaa93
Bump OCI8 version to make a PECL release for 8.2 2023-04-20 18:01:43 +10:00
Ilija Tovilo
72fc8b51a4
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix mysql tests with non-standard server port
2023-04-20 08:45:52 +02:00
Michael Voříšek
0ab51a9561
Fix mysql tests with non-standard server port
Closes GH-9744
2023-04-20 08:45:14 +02:00
Ilija Tovilo
f948f79696
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add all conflict to curl
2023-04-19 16:24:16 +02:00
Ilija Tovilo
af6b413691
[skip ci] Add all conflict to curl 2023-04-19 16:23:52 +02:00
Derick Rethans
1dcab8a534 Add NEWS entry 2023-04-18 13:48:29 +01:00
Derick Rethans
d1af263dd9 Merge remote-tracking branch 'derickr/fix-datetime-diff-around-dst-transition' into PHP-8.2 2023-04-18 13:47:00 +01:00
Derick Rethans
cc7b799c44 Fixed tests 2023-04-18 13:46:07 +01:00
Derick Rethans
44eef677b0 Import timelib 2022.06 2023-04-18 13:46:07 +01:00
Remi Collet
6adf2f65a1
[ci skip] NEWS for 11071 2023-04-18 11:46:18 +02:00
Remi Collet
5c6ccc4965
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS for 11071
2023-04-18 11:46:03 +02:00
Remi Collet
6e8f0f53b1
[ci skip] NEWS for 11071 2023-04-18 11:45:50 +02:00
Remi Collet
f5dc2c31d9
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11071: Revert "Fix [-Wundef] warning in INTL extension"
2023-04-18 11:04:54 +02:00
Remi Collet
31e21f7dbc
Fix GH-11071: Revert "Fix [-Wundef] warning in INTL extension"
This reverts commit ea8686540a.
2023-04-18 11:04:28 +02:00
Ilija Tovilo
35c1bb2e47
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Support enums in array_unique
2023-04-16 15:35:55 +02:00
Ilija Tovilo
e8b8341d3d
Support enums in array_unique
Fixes GH-9775
Closes GH-11015
2023-04-16 15:34:56 +02:00
Jakub Zelenka
6d33a1ab70
Merge branch 'PHP-8.1' into PHP-8.2 2023-04-16 10:55:02 +01:00
Jakub Zelenka
84be9042f9
Add missing zend_test_crash message initialization 2023-04-16 10:54:39 +01:00
Jakub Zelenka
9a20f43b94
Merge branch 'PHP-8.1' into PHP-8.2 2023-04-15 21:29:11 +01:00
Jakub Zelenka
0ac55e9bfb
Add zend_test_crash funtion to segfault PHP process
This is useful for testing PHP-FPM handling of crashed children.

Closes GH-11082
2023-04-15 21:25:02 +01:00
Niels Dossche
1799327356 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11028: Heap Buffer Overflow in zval_undefined_cv.
2023-04-15 18:30:47 +02:00
Niels Dossche
fc32d39b7f Fix GH-11028: Heap Buffer Overflow in zval_undefined_cv.
For analysis see https://github.com/php/php-src/issues/11028#issuecomment-1508460440

Closes GH-11083.
2023-04-15 18:22:55 +02:00
Ilija Tovilo
edd4980199
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Fix Slack notification
2023-04-13 13:52:42 +02:00
Ilija Tovilo
2eeff96df5
[skip ci] Fix Slack notification
ravsamhq/notify-slack-action doesn't work on MacOS, so we use curl directly.
2023-04-13 13:52:23 +02:00
Ilija Tovilo
023e17a89d
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Skip bug45161.phpt on Windows
2023-04-13 13:20:45 +02:00
Ilija Tovilo
4b22c3e3ad
[skip ci] Skip bug45161.phpt on Windows
See GH-10753

The test is insanely slow on Windows and it's unclear why. It might be a curl
issue.
2023-04-13 13:19:52 +02:00
Ilija Tovilo
de9ea68ad8
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix test bug60120.phpt
2023-04-13 12:57:10 +02:00
Ilija Tovilo
dd44a9330e
Fix test bug60120.phpt
The process cmd was broken. We're now also checking that the process output is
actually what we expect.

Closes GH-11064
2023-04-13 12:56:18 +02:00
Derick Rethans
d3f82f30b7 Merge branch 'PHP-8.1' into PHP-8.2 2023-04-12 11:39:02 +01:00
Derick Rethans
884eb4bba6 Merge remote-tracking branch 'derickr/fixed-broken-date-time-tests' into PHP-8.1 2023-04-12 11:36:39 +01:00
Niels Dossche
805f21b9bf Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] UPDATE NEWS
2023-04-11 22:18:59 +02:00
Niels Dossche
450fcc4c9b [ci skip] UPDATE NEWS
ElliotNB helped me a lot debugging this by constantly testing the
patches. It is only fair that he is mentioned too, as I couldn't have
solved it without his help.
2023-04-11 22:17:47 +02:00
Jakub Zelenka
d638c0d1e3
Merge branch 'PHP-8.1' into PHP-8.2 2023-04-11 12:48:23 +01:00
Jakub Zelenka
4be6435c9f
Use curl from brew on MacOS CI
This fixes issue in curl ext SSL client cert setting test.

Closes GH-11056
2023-04-11 12:46:25 +01:00
Dmitry Stogov
e14ac1caee Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Allow FETCH_OBJ_W and FETCH_STATIC_PROP_W to return INDIRECT/UNDEF zval for uninitialized typed properties (#11048)
2023-04-10 23:25:08 +03:00
Dmitry Stogov
0c65b396d6
Allow FETCH_OBJ_W and FETCH_STATIC_PROP_W to return INDIRECT/UNDEF zval for uninitialized typed properties (#11048) 2023-04-10 23:19:17 +03:00
Alex Dowad
7cef7cb0ee Add more details in UPGRADING on mb_check_encoding changes 2023-04-10 19:47:03 +02:00
Niels Dossche
9261ff7ba9 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10737: PHP 8.1.16 segfaults on line 597 of sapi/apache2handler/sapi_apache2.c
2023-04-08 16:42:52 +02:00
Niels Dossche
51faf04dbd Fix GH-10737: PHP 8.1.16 segfaults on line 597 of sapi/apache2handler/sapi_apache2.c
The TSRM keeps a hashtable mapping the thread IDs to the thread resource pointers.
It's possible that the thread disappears without us knowing, and then another thread
gets spawned some time later with the same ID as the disappeared thread.
Note that since it's a new thread the TSRM key pointer and cached pointer will be NULL.

The Apache request handler `php_handler()` will try to fetch some fields from the SAPI globals.
It uses a lazy thread resource allocation by calling `ts_resource(0);`.
This allocates a thread resource and sets up the TSRM pointers if they haven't been set up yet.

At least, that's what's supposed to happen. But since we are in a situation where the thread ID
still has the resources of the *old* thread associated in the hashtable,
the loop in `ts_resource_ex` will find that thread resource and assume the thread has been setup
already. But this is not the case since this thread is actually a new thread, just reusing the ID
of the old one, without any relation whatsoever to the old thread.
Because of this assumption, the TSRM pointers will not be setup, leading to a
NULL pointer dereference when trying to access the SAPI globals.

We can easily detect this scenario: if we're in the fallback path, and the pointer is NULL,
and we're looking for our own thread resource, we know we're actually reusing a thread ID.
In that case, we'll free up the old thread resources gracefully (gracefully because
there might still be resources open like database connection which need to be
shut down cleanly). After freeing the resources, we'll create the new resources for
this thread as if the stale resources never existed in the first place.
From that point forward, it is as if that situation never occurred.
The fact that this situation happens isn't that bad because a child process containing
threads will eventually be respawned anyway by the SAPI, so the stale thread resources
won't remain forever.

Note that we can't simply assign our own TSRM pointers to the existing
thread resource for our ID, since it was actually from a different thread
(just with the same ID!). Furthermore, the dynamically loaded extensions
have their own pointer, which is only set when their constructor is
called, so we'd have to call their constructor anyway...
I also tried to call the dtor and then the ctor again for those resources
on the pre-existing thread resource to reuse storage, but that didn't work properly
because other code doesn't expect something like that to happen, which breaks assumptions,
and this in turn caused Valgrind to (rightfully) complain about memory bugs.

Note 2: I also had to fix a bug in the core globals destruction because it
always assumed that the thread destroying them was the owning thread,
which on TSRM shutdown isn't always the case. A similar bug was fixed
recently with the JIT globals.

Closes GH-10863.
2023-04-08 16:34:07 +02:00