1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00
Commit Graph

131588 Commits

Author SHA1 Message Date
Ilija Tovilo 779ab32d4f Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Mark failing date test as xfail
2023-03-10 17:34:17 +01:00
Ilija Tovilo cc902530f2 [skip ci] Mark failing date test as xfail 2023-03-10 17:33:56 +01:00
Ilija Tovilo 47f80ffc77 Remove unnecessary type punnign from mysqli_api.c
value is a long. On big-endian architectures mysql_stmt_attr_get() will write to
the most significant byte. Type punning was used to move that byte to the least
significant one, which is UB. We can avoid this by simply casting to my_bool
(alias of bool). Previously, a comparison against 0 should've been done.
2023-03-10 17:15:46 +01:00
Ilija Tovilo f60dc47f36 Re-enable -Wstrict-aliasing
We're not disabling -fstrict-aliasing to it's better to keep this warning.

Closes GH-10821
2023-03-10 17:15:46 +01:00
Kévin Dunglas f0495855a3 feat: enable Zend Max Execution Timers by default in 8.3 (#10778) 2023-03-10 16:22:42 +01:00
Derick Rethans afd42610c0 Merge branch 'PHP-8.2' 2023-03-10 14:43:51 +00:00
Derick Rethans dfb8cffc59 Merge remote-tracking branch 'derickr/gh10747' into PHP-8.2 2023-03-10 14:43:44 +00:00
Derick Rethans a225581833 Fix GH-10747: Private and protected properties in serialized Date* objects throw 2023-03-10 14:39:22 +00:00
George Peter Banyard 1d9d1fe109 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10519: Array Data Address Reference Issue
2023-03-10 14:24:54 +00:00
George Peter Banyard 4808fb6932 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10519: Array Data Address Reference Issue
2023-03-10 14:24:38 +00:00
NathanFreeman 49b2ff5dbb Fix GH-10519: Array Data Address Reference Issue
We need to carry around a reference to the underlying Bucket to be able to modify it by reference.

Closes GH-10749

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-03-10 14:23:30 +00:00
Ilija Tovilo 6f1e5ff8c3 Fix GC_BENCH flag (#10823)
zend_gc_globals is now hidden, so we can't access it from zend.c.
2023-03-10 15:02:22 +01:00
Kamil Tekiela 69ec3c6bc6 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix strlen error message param name

Closes GH-10784
2023-03-10 12:52:28 +00:00
Kamil Tekiela e223bf2015 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix strlen error message param name
2023-03-10 12:48:46 +00:00
Kamil Tekiela ad705afc2f Merge branch 'Fix-strlen-error-message-param-name' into PHP-8.1
* Fix-strlen-error-message-param-name:
  Fix strlen error message param name
2023-03-10 12:47:40 +00:00
Ilija Tovilo d9edda0822 [skip ci] Keep old branches on Ubuntu 20.04 on nightly 2023-03-10 11:51:12 +01:00
Ilija Tovilo 0760a57205 [skip ci] Remove references to Azure Pipelines 2023-03-10 01:32:28 +01:00
Ilija Tovilo c0ee8e833c Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Fix diff cmd env name in run-tests.php
2023-03-10 01:10:55 +01:00
Ilija Tovilo d3c9585204 [skip ci] Fix diff cmd env name in run-tests.php 2023-03-10 01:10:25 +01:00
Ilija Tovilo d98963a071 Switch to Ubuntu 22.04 for GitHub actions jobs
Closes GH-10814
2023-03-10 00:17:23 +01:00
Ilija Tovilo 08e7366d0a Merge branch 'PHP-8.2'
* PHP-8.2:
  Disable asan instrumentation for phpdbg_watchpoint_userfaultfd_thread
2023-03-10 00:14:09 +01:00
Ilija Tovilo f415ba60ab Disable asan instrumentation for phpdbg_watchpoint_userfaultfd_thread
On gcc. It reports a false positive stack-overflow.

Closes GH-10818
2023-03-10 00:13:27 +01:00
David Carlier 45677081fa ext/intl: dateformatter settimezone changes on success, returning true like setcalendar.
Closes GH-10790
2023-03-09 21:45:26 +00:00
Ilija Tovilo 9982e42fee Merge branch 'PHP-8.2'
* PHP-8.2:
  Test Windows with opcache on GitHub actions
2023-03-09 19:21:42 +01:00
Ilija Tovilo 9030a0c769 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Test Windows with opcache on GitHub actions
2023-03-09 19:21:33 +01:00
Ilija Tovilo 6b884737c4 Test Windows with opcache on GitHub actions
Fixes GH-10777
2023-03-09 19:20:02 +01:00
Derick Rethans 78937c93ef Merge branch 'PHP-8.2' 2023-03-09 13:39:31 +00:00
Derick Rethans a45bef0ac6 Merge branch 'PHP-8.1' into PHP-8.2 2023-03-09 13:37:19 +00:00
Derick Rethans 2922d678aa Merge branch 'fix-variadics-macro' into PHP-8.1 2023-03-09 13:34:01 +00:00
Niels Dossche f45b3acb90 [ci skip] Add a comment to clarify the value of zend_call_info->num_args (#10812)
This surprised me a couple of times already, and it probably surprised
others too. Add a comment to clarify.
2023-03-09 13:00:21 +00:00
Derick Rethans aead0c8059 Fixed strict zpp arginfo test 2023-03-09 12:20:56 +00:00
Derick Rethans f8891f2861 Fixed strict zpp arginfo test 2023-03-09 11:40:47 +00:00
Derick Rethans 8a9b80cfe0 Add test case 2023-03-09 11:40:45 +00:00
Derick Rethans 717335ec63 Fixed macro generation for variadics, which don't have a default value 2023-03-09 11:39:22 +00:00
Máté Kocsis 574e531127 Micro optimization: readonly properties always have a type 2023-03-09 10:03:47 +01:00
George Peter Banyard afd8695a22 Suppress -Wstrict-prototypes in GD extension (#10803)
GD uses variadict functions where the signature depends on the library and types of images.
Until we can use void f(...) that was introduced in C23 suppress this warning.
2023-03-09 07:02:20 +00:00
Ilija Tovilo 4379aa0231 Merge branch 'PHP-8.2'
* PHP-8.2:
  Update libmysql 5.7 version
2023-03-08 22:18:25 +01:00
Ilija Tovilo 1616ae2fb6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Update libmysql 5.7 version
2023-03-08 22:18:16 +01:00
Ilija Tovilo 12290b796b Update libmysql 5.7 version 2023-03-08 22:17:48 +01:00
Ilija Tovilo 0d5c794967 [skip ci] Skip PECL nightly on forks 2023-03-08 11:21:54 +01:00
Niels Dossche b39ff334a3 Merge branch 'PHP-8.2'
* PHP-8.2:
  Re-add some CTE functions that were removed from being CTE by a mistake
  Fix GH-8065: opcache.consistency_checks > 0 causes segfaults in PHP >= 8.1.5 in fpm context
  Fix GH-8646: Memory leak PHP FPM 8.1
2023-03-07 20:36:41 +01:00
Michael Voříšek 411cd04541 Re-add some CTE functions that were removed from being CTE by a mistake
These functions were accidentally removed from being CTE in GH-7780.
This patch brings them back.

Closes GH-10768.
2023-03-07 20:30:11 +01:00
Niels Dossche 7682868dd1 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-8065: opcache.consistency_checks > 0 causes segfaults in PHP >= 8.1.5 in fpm context
  Fix GH-8646: Memory leak PHP FPM 8.1
2023-03-07 20:26:57 +01:00
Niels Dossche 85df512a12 Fix GH-8065: opcache.consistency_checks > 0 causes segfaults in PHP >= 8.1.5 in fpm context
Disable opcache.consistency_checks.

This feature does not work right now and leads to memory leaks and other
problems. For analysis and discussion see GH-8065. In GH-10624 it was
decided to disable the feature to prevent problems for end users.
If end users which to get some consistency guarantees, they can rely on
opcache.protect_memory.

Closes GH-10798.
2023-03-07 20:17:55 +01:00
Niels Dossche ff62d117a3 Fix GH-8646: Memory leak PHP FPM 8.1
Fixes GH-8646
See https://github.com/php/php-src/issues/8646 for thorough discussion.

Interned strings that hold class entries can get a corresponding slot in map_ptr for the CE cache.
map_ptr works like a bump allocator: there is a counter which increases to allocate the next slot in the map.

For class name strings in non-opcache we have:
  - on startup: permanent + interned
  - on request: interned
For class name strings in opcache we have:
  - on startup: permanent + interned
  - on request: either not interned at all, which we can ignore because they won't get a CE cache entry
                or they were already permanent + interned
                or we get a new permanent + interned string in the opcache persistence code

Notice that the map_ptr layout always has the permanent strings first, and the request strings after.
In non-opcache, a request string may get a slot in map_ptr, and that interned request string
gets destroyed at the end of the request. The corresponding map_ptr slot can thereafter never be used again.
This causes map_ptr to keep reallocating to larger and larger sizes.

We solve it as follows:
We can check whether we had any interned request strings, which only happens in non-opcache.
If we have any, we reset map_ptr to the last permanent string.
We can't lose any permanent strings because of map_ptr's layout.

Closes GH-10783.
2023-03-07 20:16:17 +01:00
Michael Voříšek 3821938e81 Imply UTF8 validity in implode function (#10780)
Sets the UTF-8 valid flag if all parts are valid, or numeric (which are valid UTF-8 by definition).

* remove unuseful comments

* Imply UTF8 validity in implode function

* revert zend_string_dup change
2023-03-07 19:30:35 +01:00
George Peter Banyard 67b5e6b819 [skip ci] Update UPGRADING for saner array_(sum|product)() RFC 2023-03-07 15:49:00 +00:00
George Peter Banyard 3b06618813 RFC: Saner array_(sum|product)() (#10161)
RFC: https://wiki.php.net/rfc/saner-array-sum-product

Moreover, the internal fast_add_function() function was removed.
2023-03-07 15:40:17 +00:00
Michael Orlitzky 88b30e08cc ext/iconv/config.m4: add missing stdio.h include.
The next generation of C compilers is going to enforce the C standard
more strictly:

  https://wiki.gentoo.org/wiki/Modern_C_porting

One warning that will eventually become an error is
-Wimplicit-function-declaration. This is relatively easy to catch in
most code (it will fail to compile), but inside of autoconf tests it
can go unnoticed because many feature-test compilations fail by
design. For example,

  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iconv.h>]],
                 [[iconv_ccs_init(NULL, NULL);]])]...

is designed to fail if iconv_ccs_init() is not in iconv.h. On the
other hand,

  AC_RUN_IFELSE([AC_LANG_SOURCE([[
  #include <iconv.h>
  int main() {
    printf("%d", _libiconv_version);
    return 0;
  }

should pass if _libiconv_version is defined. If the user has
-Werror=implicit-function-declaration in his CFLAGS, however,
it will not:

  $ export CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
  $ ./configure
  ...
  checking if using GNU libiconv... no

This is because the stdio.h header that defines printf() is missing:

  conftest.c:240:3: error: implicit declaration of function 'printf'
  [-Werror=implicit-function-declaration]
    240 |   printf("%d", _libiconv_version);
        |   ^~~~~~
  conftest.c:239:1: note: include '<stdio.h>' or provide a declaration
  of 'printf'

This commit adds the include, correcting the test with any compiler
that balks at implicit function definitions.

Closes GH-10751
2023-03-07 15:32:30 +00:00
Michael Orlitzky fa65873502 */*.m4: update main() signatures.
The next generation of C compilers is going to enforce the C standard
more strictly:

  https://wiki.gentoo.org/wiki/Modern_C_porting

One warning that will soon become an error is -Wstrict-prototypes.
This is relatively easy to catch in most code (it will fail to
compile), but inside of autoconf tests it can go unnoticed because
many feature-test compilations fail by design. For example,

  $ export CFLAGS="$CFLAGS -Werror=strict-prototypes"
  $ ./configure
  ...
  checking if iconv supports errno... no
  configure: error: iconv does not support errno

(this is on a system where iconv *does* support errno). If errno
support were optional, that test would have "silently" disabled
it. The underlying issue here, from config.log, is

  conftest.c:211:5: error: function declaration isn't a prototype
  [-Werror=strict-prototypes]
    211 | int main() {

This commit goes through all of our autoconf tests, replacing main()
with main(void). Up to equivalent types and variable renamings, that's
one of the two valid signatures, and satisfies the compiler (gcc-12 in
this case).

Fixes GH-10751
2023-03-07 15:32:30 +00:00