Commit graph

130920 commits

Author SHA1 Message Date
Max Kellermann
4069a5c43f Zend/zend_execute: always include zend_globals.h
Commit ecc880f491 was incomplete; EG() is used in inline functions
outside of ZEND_DEBUG.
2023-01-15 15:07:58 +00:00
Niels Dossche
a60c6ee0ac
Mark constant static arrays in function bodies actually as const (#10325) 2023-01-15 14:51:31 +00:00
Niels
e951202a69
Remove useless check, search_str is always true here (#10322) 2023-01-15 00:32:51 +01:00
Jakub Zelenka
abc41c2e00
Merge branch 'PHP-8.2' 2023-01-14 15:15:12 +00:00
Jakub Zelenka
d0dd77a3c2
Merge branch 'PHP-8.1' into PHP-8.2 2023-01-14 15:14:44 +00:00
Jakub Zelenka
7d98e3e40c
Fix missing comment in FPM www.conf.in 2023-01-14 15:13:55 +00:00
Arnaud Le Blanc
a493da7b9d
Fix typo in HAVE_ macro (#10310) 2023-01-14 13:43:26 +01:00
Arnaud Le Blanc
2a5c03cd72 [ci skip] NEWS 2023-01-14 12:19:58 +01:00
Niels
6ab503814d
Make array_pad's $length warning less confusing (#10149)
Remove array_pad's arbitrary length restriction

The error message was wrong; it *is* possible to use a larger length.
Furthermore, there is an arbitrary restriction on the new array's
length.

Fix both by checking the length against HT_MAX_SIZE.
2023-01-14 12:15:56 +01:00
David CARLIER
690db97c6d
intl extension couple of micro optimisations for error edge cases. (#10044)
making c++ compile time few enums ranges.
2023-01-14 07:26:05 +00:00
Arnaud Le Blanc
9788244a42 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix run-tests.php hanging when a worker process dies without notice (#9931)
2023-01-13 18:07:58 +01:00
Arnaud Le Blanc
61048f984a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix run-tests.php hanging when a worker process dies without notice (#9931)
2023-01-13 18:07:45 +01:00
Arnaud Le Blanc
8c0698f66b
Fix run-tests.php hanging when a worker process dies without notice (#9931)
run-tests.php with `-jN` can hang if a parallel worker dies without notice. This
can happen due to fatal errors in the worker, or if the worker is killed.

- run-tests.php (main process)
  \_ run-tests.php (worker #0) // main process hangs if this one crashes
     \_ test-001.php (test-001.phpt)
2023-01-13 17:43:17 +01:00
Arnaud Le Blanc
2b1907786c
zend_hash_check_size: allow nSize <= HT_MAX_SIZE (#10244)
This is consistent with other uses of HT_MAX_SIZE
2023-01-13 17:42:43 +01:00
Max Kellermann
7473b86f10
build/php.m4: remove test for integer types (#10304)
These are mandatory in C99, so it's a pointless waste of time to check
for them.

(Actually, the fixed-size integer types are not mandatory, but if they
are really not available on some theoretical system, PHP's fallbacks
won't work either, so nothing is gained from this check.)
2023-01-13 11:51:15 +00:00
Arnaud Le Blanc
ba091ab3c7 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)
  GC fiber unfinished executions (#9810)
2023-01-13 12:31:12 +01:00
Arnaud Le Blanc
871d9f2d70 [ci skip] NEWS 2023-01-13 12:29:51 +01:00
Arnaud Le Blanc
d89408075f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)
  GC fiber unfinished executions (#9810)
2023-01-13 12:28:21 +01:00
Arnaud Le Blanc
0f7625c47c
Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)
zend_hash allocates a hash table twice as big as nTableSize
(HT_HASH_SIZE(HT_SIZE_TO_MASK(nTableSize)) == nTableSize*2), so HT_MAX_SIZE
must be half the max table size or less.

Fixes GH-10240
2023-01-13 12:05:51 +01:00
Arnaud Le Blanc
4fb149390a
GC fiber unfinished executions (#9810) 2023-01-13 12:04:28 +01:00
Jakub Zelenka
0d74362f63
Merge branch 'PHP-8.2' 2023-01-13 10:33:51 +00:00
Jakub Zelenka
a8c387e89c
Merge branch 'PHP-8.1' into PHP-8.2 2023-01-13 10:32:52 +00:00
Jakub Zelenka
120aafcc42
Fix bug #67244: Wrong owner:group for listening unix socket
Update FPM www.conf to reflect the actual logic
2023-01-13 10:31:01 +00:00
Max Kellermann
061fcdb0a5
ext/opcache: use C11 atomics for "restart_in" (#10276)
Cheaper than fcntl(F_SETLK).  The same is done already on Windows, so
if that works, why not use it everywhere?  (Of course, only if the
compiler supports this C11 feature.)

As a bonus, the code in this commit also works on C++ via C++11
std::atomic, just in case somebody adds some C++ code to the opcache
extension one day.
2023-01-13 00:02:35 +01:00
Tim Düsterhus
4c9ae81c28
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix comment for php_safe_bcmp (#10306)
2023-01-12 23:31:08 +01:00
Tim Düsterhus
fd7214436a
Fix comment for php_safe_bcmp (#10306)
* main: Fix comment for php_safe_bcmp

* main: Include note about php_safe_bcmp being security sensitive

This is taken from the implementation of `hash_equals()`.
2023-01-12 23:30:36 +01:00
David Carlier
9198e8894b socket DF flag on UDP socket via IP_MTU_DISCOVER on Linux and IP_DONTFRAGMENT on FreeBSD for path MTU discovery purpose.
idea proposal via ml :
https://marc.info/?l=php-internals&m=167329288509393&w=2

Close GH-10282
2023-01-12 22:22:30 +00:00
David Carlier
55d19eee49 posix adding posix_fpathconf.
follow-up on GH-10238 but with the file descriptor flavor.

Close GH-10253
2023-01-12 22:15:31 +00:00
David Carlier
41c0304647 Merge branch 'PHP-8.2' 2023-01-12 22:01:39 +00:00
David Carlier
884e8a970a Merge branch 'PHP-8.1' into PHP-8.2 2023-01-12 22:01:30 +00:00
Niels Dossche
833b45ac44 Fix GH-10249: Assertion `size >= page_size + 1 * page_size' failed.
Co-authored-by: Changochen <changochen1@gmail.com>

Closes GH-10284
2023-01-12 22:00:00 +00:00
Tim Düsterhus
8edd4a2ed8
Merge branch 'PHP-8.2'
* PHP-8.2:
  Revert "Make build work with newer OpenSSL"
  [ci skip] Next release will be 8.0.28
  [ci skip] Prepare for PHP 8.0.27 GA
2023-01-12 21:52:55 +01:00
Tim Düsterhus
8c7aacd760
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Revert "Make build work with newer OpenSSL"
  [ci skip] Next release will be 8.0.28
  [ci skip] Prepare for PHP 8.0.27 GA
2023-01-12 21:52:48 +01:00
Tim Düsterhus
0116864cd3
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Revert "Make build work with newer OpenSSL"
  [ci skip] Next release will be 8.0.28
  [ci skip] Prepare for PHP 8.0.27 GA
2023-01-12 21:48:23 +01:00
Tim Düsterhus
71bdcce9f8
Stop using the deprecated set-output command in nightly_matrix.php (#10302)
see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-01-12 20:07:31 +01:00
Tim Düsterhus
013e0f98ac
Merge branch 'PHP-8.2'
* PHP-8.2:
  unserialize: Strictly check for `:{` at object start (#10214)
2023-01-12 19:57:22 +01:00
Tim Düsterhus
f2e8c5da90
unserialize: Strictly check for :{ at object start (#10214)
* unserialize: Strictly check for `:{` at object start

* unserialize: Update CVE tests

It's unlikely that the object syntax error contributed to the actual CVE. The
CVE is rather caused by the incorrect object serialization data of the `C`
format. Add a second string without such a syntax error to ensure that path is
still executed as well to ensure the CVE is absent.

* Fix test expectation in gmp/tests/bug74670.phpt

No changes to the input required, because the test actually is intended to
verify the behavior for a missing `}`, it's just that the report position changed.

* NEWS

* UPGRADING
2023-01-12 19:55:54 +01:00
George Peter Banyard
410e78651a
Merge branch 'PHP-8.2'
* PHP-8.2:
  Use absolute paths in OPCache tests when calling `opcache_compile_file()`
2023-01-12 15:48:13 +00:00
George Peter Banyard
31fd34aa4c
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Use absolute paths in OPCache tests when calling `opcache_compile_file()`
2023-01-12 15:48:01 +00:00
Thomas Gerbet
1f715f5658
Use absolute paths in OPCache tests when calling opcache_compile_file()
This make sure the tests do not fail if they are not run from the
repository root.

Closes GH-10266

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-12 15:47:24 +00:00
Alex Dowad
a90358639d Implement conditional casing for Greek letter sigma when title-casing text 2023-01-12 17:41:11 +02:00
Alex Dowad
290efe842d Adjust code which checks if encoding is ISO-8859-9 when converting case
Instead of checking the 'encoding number' to see if we are converting
case for ISO-8859-9 text, compare pointers instead.

This should free up 1 register in php_unicode_convert_case.
2023-01-12 17:41:11 +02:00
Alex Dowad
39b46a5398 Implement Unicode conditional casing rules for Greek letter sigma
The capital Greek letter sigma (Σ) should be lowercased as σ except
when it appears at the end of a word; in that case, it should be
lowercased as the special form ς.

This rule is included in the Unicode data file SpecialCasing.txt.
The condition for applying the rule is called "Final_Sigma" and is
defined in Unicode technical report 21. The rule is:

• For the special casing form to apply, the capital letter sigma must
  be preceded by 0 or more "case-ignorable" characters, preceded by
  at least 1 "cased" character.
• Further, capital sigma must NOT be followed by 0 or more
  case-ignorable characters and then at least 1 cased character.

"Case-ignorable" characters include certain punctuation marks, like
the apostrophe, as well as various accent marks. There are actually
close to 500 different case-ignorable characters, including accent marks
from Cyrillic, Hebrew, Armenian, Arabic, Syriac, Bengali, Gujarati,
Telugu, Tibetan, and many other alphabets. This category also includes
zero-width spaces, codepoints which indicate RTL/LTR text direction,
certain musical symbols, etc.

Since the rule involves scanning over "0 or more" of such
case-ignorable characters, it may be necessary to scan arbitrarily far
to the left and right of capital sigma to determine whether the special
lowercase form should be used or not. However, since we are trying to
be both memory-efficient and CPU-efficient, this implementation limits
how far to the left we will scan. Generally, we scan up to 63 characters
to the left looking for a "cased" character, but not more.

When scanning to the right, we go up to the end of the string if
necessary, even if it means scanning over thousands of characters.

Anyways, it is almost impossible to imagine that natural text will
include "words" with more than 63 successive apostrophes (for example)
followed by a capital sigma.

Closes GH-8096.
2023-01-12 17:41:11 +02:00
Max Kellermann
24b311bdd7 ext/opcache/zend_shared_alloc: rename _register_xlat_entry() params
The name "new" happens to be a C++ keyword, which was the my reason to
rethink those names.

The "xlat_table" is not only used to translate pointers for persisting
scripts to shared memory, but is also used to annoate pointers
(e.g. by the JIT to associate an op_array with its jit_extension).

The names "old" and "new" aren't good for that; often, there's nothing
"old" or "new" about them.  It's actually a generic lookup table, and
"old" shall be named "key" (which it is called internally already),
and "new" is renamed to simply "value".
2023-01-12 15:14:05 +00:00
Max Kellermann
b47bfd698d ext/opcache: C++ compatibility
Just in case somebody includes those headers from C++ code.  The same
already exists in other opcache headers.
2023-01-12 15:14:05 +00:00
Max Kellermann
45a128c9de Zend/zend_types: include cleanup 2023-01-12 15:12:45 +00:00
Max Kellermann
1eb71c3f15 Zend/zend_map_ptr: include cleanup 2023-01-12 15:12:45 +00:00
Max Kellermann
492523a779 Zend/zend_inference: include cleanup 2023-01-12 15:12:45 +00:00
Max Kellermann
c7a4633891 Zend/Optimizer/zend_call_graph: include cleanup 2023-01-12 15:12:45 +00:00
Max Kellermann
308adb915c Zend/Optimizer/sccp: include cleanup 2023-01-12 15:12:45 +00:00