Commit Graph

135458 Commits

Author SHA1 Message Date
Niels Dossche
b9bb8d62ca Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix incorrect charset length in check_mb_eucjpms()
2024-03-22 11:32:23 +01:00
Niels Dossche
67ce1d859d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix incorrect charset length in check_mb_eucjpms()
2024-03-22 11:32:15 +01:00
Niels Dossche
8ffac997aa Fix incorrect charset length in check_mb_eucjpms()
Closes GH-13781.
2024-03-22 11:31:36 +01:00
Remi Collet
ec2ace7f83
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix AX_GCC_FUNC_ATTRIBUTE failure
2024-03-22 11:30:24 +01:00
Remi Collet
2b7917391c
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix AX_GCC_FUNC_ATTRIBUTE failure
2024-03-22 11:30:07 +01:00
Remi Collet
09a36812c1
Fix AX_GCC_FUNC_ATTRIBUTE failure 2024-03-22 11:29:45 +01:00
Peter Kokot
530e0d68eb
Create modules directory in a centralized location (#13411)
Shared objects of extensions during the *nix build are copied to the
`modules` directory. It is a practice established since the early days
of the PHP build system. Other build systems may have similar concept of
"library destination directory". On Windows, they are put into the root
build directory. Such directory simplifies collection of the shared
extensions during testing, or when running the cli executable at the end
of the build process.

This change ensures that the directory is consistently created in a
single location, for both the primary PHP build process and when
utilizing `phpize` within community extensions.

The AC_CONFIG_COMMANDS_PRE is executed at the end of the configuration
phase, before creating the config.status script, where also build
directories and global Makefile are created.

The pwd is executed using the recommended $(...) instead of the obsolete
backticks. Autoconf automatically locates the proper shell and
re-executes the configure script if such case is found that $(...) is
not supported (the initial /bin/sh on Solaris 10, for example).
2024-03-21 17:43:49 +01:00
Peter Kokot
79e4ca1e41
Remove outdated Zend/zend_istdiostream.h file (#13765)
This removes the unused and obsolete Zend/zend_istdiostream.h header and
symbols on Windows:
- HAVE_STDIOSTR_H
- HAVE_CLASS_ISTDIOSTREAM
- istdiostream
2024-03-21 10:37:14 +01:00
Niels Dossche
e1630381b7
Fix GH-13764: xsl cannot build on PHP 8.4 (#13770)
Move some of the DOM APIs from the non-public php_dom.h header to the
public header xml_common.h.
2024-03-20 19:03:09 +01:00
tekimen
4d51bfa270
[RFC] Add mb_ucfirst and mb_lcfirst functions (#13161) 2024-03-20 17:25:19 +01:00
Niels Dossche
5430ecd3db Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix phpdoc for DOMDocument load methods
2024-03-20 17:23:47 +01:00
Niels Dossche
05989e9e2c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix phpdoc for DOMDocument load methods
2024-03-20 17:23:26 +01:00
Vincent Langlet
741570c30f Fix phpdoc for DOMDocument load methods
Closes GH-13763.
2024-03-20 17:22:04 +01:00
Ilija Tovilo
8dbc4b61c3
Disable ASLR for benchmark (#13769) 2024-03-20 17:20:29 +01:00
Peter Kokot
4bf64b53ef
Remove unused zend_dump_variables() (#13767) 2024-03-20 14:37:32 +01:00
Peter Kokot
b7e1ec9108
Remove unused zend_shutdown_constants() (#13657)
The zend_shutdown_constants() usage was removed in
21698c12fe (memory leak)
and in b80cb7bd2f (unicode support).
2024-03-20 14:12:45 +01:00
Dmitry Stogov
f87632e7ca Update IR
IR commit: 7586ac611a32d8f4116721b1d96b855c1087eac9
2024-03-20 13:49:21 +03:00
Dmitry Stogov
fa512dc4cb Use new abilities or ir_save() 2024-03-20 13:22:47 +03:00
Dmitry Stogov
eb513503c0 Update IR
IR commit: 0e3608e3c945140d366134034ee8d86edbe6d050
2024-03-20 13:22:11 +03:00
Dmitry Stogov
0bf063dce6 Disabe test for 32-bit build 2024-03-20 13:21:41 +03:00
Ilija Tovilo
bc59e79d21
Merge branch 'PHP-8.3'
* PHP-8.3:
  Restore error handler after running it
2024-03-20 10:53:35 +01:00
Ilija Tovilo
3301d9602a
Restore error handler after running it
Symfony relies on finding the exception handler in the handler stack. There's
currently no clean API to find it, so they pop all the handlers, and push them
again once the stack is empty. This PR attempts to minimize the BC break by
pushing the current handler onto the stack and clearing the current handler, and
restoring it once it has finished. This is essentially equivalent to
set_exception_handler(null) and restore_exception_handler().

restore_exception_handler() however is only called if the exception handler is
still unset. If the handler has pushed a new handler in the meantime, we assume
it knows what it's doing.

Fixes GH-13446
Closes GH-13686
2024-03-20 10:53:20 +01:00
Tim Düsterhus
6fb20cd9de
random: Simplify implementation of php_random_generate_fallback_seed() (#13761)
As all the input bits and pieces are mixed with SHA-1, cross-architecture
compatibility is not required and we can just mix in whatever they may look
like in memory, instead of going through the `write_*()` helpers that were
created for a previous in-development version that first filled a buffer that
was then hashed (allowing for easy inspection of the input data, but making it
harder to safely add values without checking for buffer overflows all the
time).

This change should also fix a build error on macOS ZTS: The thread ID is an
opaque type and not guaranteed to be arithmetic as per IEEE Std 1003.1-2017.
And indeed macOS defines it as a pointer to a structure, failing due to the
implicit pointer to integer conversion.
2024-03-20 09:41:01 +01:00
David Carlier
2e7c6e1eb2 freebsd CI reeanable werror 2024-03-19 22:39:32 +00:00
David Carlier
623a980af3 Merge branch 'PHP-8.3' 2024-03-19 22:38:43 +00:00
David Carlier
f2f656c97e CI: update freebsd 13 image.
13.2 is going to be EOL.

close GH-13622
2024-03-19 22:36:33 +00:00
David Carlier
f2ec6e4806 Merge branch 'PHP-8.2' into PHP-8.3 2024-03-19 22:35:18 +00:00
David Carlier
db063cb771 CI: update freebsd 13 image.
13.2 is going to be EOL.

close GH-13622
2024-03-19 22:34:56 +00:00
Tim Düsterhus
807524d61c
random: Use CSPRNG for CombinedLCG seeding (#13748)
Now that the CombinedLCG is no longer used within GENERATE_SEED(), we can
safely use the CSPRNG with a php_random_generate_fallback_seed() fallback to
seed the CombinedLCG.
2024-03-19 20:13:44 +01:00
Ilija Tovilo
5b7d45822a
Fix missing llvm deps inside docker 2024-03-19 17:34:18 +01:00
Ilija Tovilo
25a8f155f2
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix ASan build
2024-03-19 17:17:21 +01:00
Ilija Tovilo
697d1a1c63
Fix ASan build
See https://github.com/actions/runner-images/issues/9491#issuecomment-1989718917

The mentioned workaround doesn't work for us because we run ASan inside Docker.
Instead, we switch to ubuntu-20.04 as the host. The docker setup itself remains
the same.

Closes GH-13757
2024-03-19 17:15:36 +01:00
Arnaud Le Blanc
df7252624f [ci skip] NEWS 2024-03-19 13:06:29 +01:00
Arnaud Le Blanc
1bae61a4d2
Compress interned string table offsets and increase maximum supported buffer size (#13676)
Compress interned string table offsets and increase maximum supported buffer size

The interned string buffer is organized as a header + a hash table + a
zend_string arena. Hash slots point to the arena, but are represented as 32bit
offsets from the buffer, which limits the maximum buffer size to about 4GiB.
However zend_strings are 8-byte aligned in the buffer, so we can compress the
3 lower bits. This allows to increase the maximum supported interned string
buffer size from 4095 MiB to 32767 MiB.
2024-03-19 13:01:30 +01:00
Máté Kocsis
5bb03158b6
Add the last few remaining constants to stubs (#13751)
Basically all constants are now declared via stubs. The rest of the constants are either deprecated (`SID` or `MHASH_*`) or out of interest (`__COMPILER_HALT_OFFSET__` and `PHP_CLI_PROCESS_TITLE`).
2024-03-19 08:20:33 +01:00
David CARLIER
51dafc6054
Fix GH-13745: fix header inclusion in pdo_pgsql.c (#13749)
pdo/php_pdo_int.h is not part of the PDO's headers to install.
2024-03-18 23:07:41 +00:00
Máté Kocsis
5992a29724
Improve BC support of arginfo files fenerated by gen_stub.php (#13705)
- Declared compatibility expectations of stub files are now enforced by a ZEND_STATIC_ASSERT call at the top of arginfo files
- Property registration for PHP 7 is fixed: function zend_declare_property_ex() is used again instead of zend_declare_typed_property(). This has been a regression since I added support for exposing doc comments.
- As a defensive measure, deep cloning is performed before newer features (type declarations, attributes etc.) are discarded before generating legacy arginfo files. Until now, some of the objects were forgotten to be taken care of. These omissions may have resulted in some weird bugs in theory (but probably they didn't have much impact in practice).
- PHP version related conditions inside *non-legacy arginfo files* used to possibly check for the 70000 version iD until now if compatibility with PHP 7.0 was declared in a stub. This was not 100% correct, since non-legacy arginfo files are only for PHP 8.0+. Now, I made sure that at least PHP version ID 80000 is used in the preprocessor conditions. The solution was a bit tricky though...
2024-03-18 22:06:17 +01:00
Bob Weinand
4e934d789e Merge branch 'PHP-8.3' 2024-03-18 20:26:24 +01:00
Bob Weinand
50fe64c345 Merge branch 'PHP-8.2' of https://github.com/php/php-src into PHP-8.3 2024-03-18 20:26:00 +01:00
Bob Weinand
059bf33e60
Properly forward the signal to the original handler if TSRM is shutdown. (#10219)
This ensures proper handling of SIGQUIT in ZTS fpm builds outside of active requests.
2024-03-18 20:24:23 +01:00
Dmitry Stogov
968a807d97 Update IR
IR commit: 84df6f8d409c7d06daa68d96a25d0aed81dcbf4a
2024-03-18 21:47:06 +03:00
Bob Weinand
9bed0b5f2f Merge branch 'PHP-8.3' 2024-03-18 19:06:12 +01:00
Bob Weinand
6d6cd29909 Merge branch 'PHP-8.2' of https://github.com/php/php-src into PHP-8.3 2024-03-18 19:04:12 +01:00
Bob Weinand
10d912d6e3
Fix GH-13712: Segmentation fault for enabled observers when calling trait method of internal trait when opcache is loaded (#13735)
Inherited methods regardless of source must share the original runtime cache. Traits were missed.
This adds ZEND_ACC_TRAIT_CLONE to internal functions as well to allow easy distinction of these.
2024-03-18 19:02:42 +01:00
Niels Dossche
f47b7f1c70
Cleanup name handling in magic methods (#13733)
The copy was introduced in bc59289b7, and later changed in 57527455eb,
to prevent indirect modifications of magic method arguments.
This is no longer necessary because we no longer deal with zvals, but
with string directly that the VM has retrieved either as a constant, or
via zval_try_get_tmp_string().
2024-03-18 17:48:12 +01:00
Marc Bennewitz
805326fe18
An uninitialized DateTime is UNEXPECTED (#13492) 2024-03-18 16:38:30 +00:00
Bob Weinand
d539c4b8f6 Merge branch 'PHP-8.3' 2024-03-18 17:22:48 +01:00
Bob Weinand
35aef8ee87 Merge branch 'PHP-8.2' of https://github.com/php/php-src into PHP-8.3 2024-03-18 17:22:23 +01:00
Bob Weinand
6fb8b9d721 Fix possible segfault with 0x0 shared opcache base
Moving the minimum base of the shared opcache memory to the second huge page to avoid a possible 0x0 base, which may cause all sorts of segfaults.
This is not a problem on most systems which have a mmap_min_addr which is non-zero, but e.g. WSL1 doesn't have a minimum mapping address.
2024-03-18 17:18:33 +01:00
Tim Düsterhus
81744d6cf7
random: Improve the output quality of RANDOM_SEED() (#13730)
* random: Improve the output quality of RANDOM_SEED()

Previously 4 consecutive calls to `RANDOM_SEED()` each for 4 different CLI
requests resulted in:

    $ sapi/cli/php test.php
    2c13e9fde9caa
    2c13e9fd1d6b0
    2c13e9fd4de34
    2c13e9fd1610e
    $ sapi/cli/php test.php
    2c1436764fe07
    2c14367621770
    2c143676c0bf6
    2c143676e02f5
    $ sapi/cli/php test.php
    2c144995a0626
    2c14499590fe2
    2c144995c65db
    2c14499536833
    $ sapi/cli/php test.php
    2c145cb30860b
    2c145cb3ec027
    2c145cb33b4ca
    2c145cb38ff63

Now they result in:

    $ sapi/cli/php test.php
    6796973ace1b5f3d
    1913daf5c158cb4b
    255dbf24237bc8c9
    7c3ba22e60f35196
    $ sapi/cli/php test.php
    afb7cc9ba9819cd2
    3e01a71b91ad020c
    6b718364d3ef108
    bdcd17beeb4b31d2
    $ sapi/cli/php test.php
    53d36eb9b83f8788
    4381c85e816187aa
    2e9b32ee9898e71e
    31d15c946842bddb
    $ sapi/cli/php test.php
    2037a3cba88114b4
    ba0b0d93a9bb43aa
    e13d82d2421269e2
    191de474f3292240

* tree-wide: Replace GENERATE_SEED() by php_random_generate_fallback_seed()

* random: Fix NTS build

* random: Fix Windows build
2024-03-18 16:08:23 +01:00