Commit Graph

135458 Commits

Author SHA1 Message Date
Jakub Zelenka
894e17c139
Merge branch 'PHP-8.3' 2024-03-29 16:09:48 +00:00
Jakub Zelenka
caec2b6186
Merge branch 'PHP-8.2' into PHP-8.3 2024-03-29 16:09:09 +00:00
Jakub Zelenka
c087398cc2
Fix GH-13264: Part 1 - Memory leak on filter failure
Closes GH-13790
2024-03-29 16:06:49 +00:00
Jakub Zelenka
cd6a58114e Fix NEWS for the last FPM change 2024-03-29 16:05:13 +00:00
Michael Voříšek
a470110ff4 Add tests for destructors behaviour with GC 2024-03-29 16:41:22 +01:00
Paul Ripke
2d6bd1644d Fixed GH-13581: threaded mod_php fails on NetBSD with No space available for Thread Local Storage.
Close GH-13832
2024-03-29 15:16:51 +00:00
David Carlier
b82024b13c ext/sockets: adding Linux's TCP_SYNCNT constant.
Useful to control how many SYN packets the client will send to the
server before giving up establishing a connection if the server does
not respond (usually 5 or 6 by default).

Close GH-13816
2024-03-29 14:52:53 +00:00
Jakub Zelenka
4bc7ea3437
Merge branch 'PHP-8.3' 2024-03-28 15:46:22 +00:00
Jakub Zelenka
8edd621501
Merge branch 'PHP-8.2' into PHP-8.3 2024-03-28 15:45:45 +00:00
Jakub Zelenka
d0a8d41eee
Fix GH-13563: Setting bool values via env in FPM config fails
Closes GH-13786
2024-03-28 15:43:50 +00:00
Peter Kokot
413f2cd427
Refactor root build directories (#13785)
This adds all root build directories in one call. PEAR directory is
created only when enabled and duplicated Zend directory creation is
removed, because it was intended for the zend_config.h when building
out-of-source or using the config.status manually before the
PHP_ADD_BUILD_DIR was introduced in the build system.
2024-03-27 16:20:03 +01:00
SATŌ Kentarō
f00e05ee9c
Remove setlocale pragma that no longer is significant. (#13814) 2024-03-27 09:06:07 +01:00
Remi Collet
6c5814dade
revert base64_encode change 2024-03-27 08:08:43 +01:00
Dmitry Stogov
9fae55f5db Update IR
IR commit: 87cba9af675afd2ca20cbaab397ad1c83d700475
2024-03-27 00:06:15 +03:00
Niels Dossche
6316eb1b2c Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13433: Segmentation Fault in zend_class_init_statics when using opcache.preload
2024-03-26 21:29:29 +01:00
Niels Dossche
55e617691a Fix GH-13433: Segmentation Fault in zend_class_init_statics when using opcache.preload
This regressed in 9a250cc9d6, which allowed static properties to get
overridden by a trait during inheritance. In particular, because of the
change to the loop in zend_update_parent_ce(), it's not guaranteed that
all indirects are after one another.

This means that during persisting the zvals of the static members table,
some static properties may be skipped. In case of the test code, this
means that the array in the trait will keep referring to the old, new
freed, stale value. To solve this, we check the type for IS_INDIRECT,
which is the same as what zend_persist_calc() is already doing anyway.

Since 2543e61aed we can check for IS_INDIRECT to see if it should be
persisted or not.

Closes GH-13794.
2024-03-26 21:29:07 +01:00
Eric Mann
93b49d9b75
Merge branch 'PHP-8.3' 2024-03-26 10:26:31 -07:00
Eric Mann
9381129d1b
PHP-8.3 is now for PHP 8.3.6-dev 2024-03-26 09:08:14 -07:00
Pierrick Charron
0966f1ffe2
Merge branch 'PHP-8.3'
* PHP-8.3:
  PHP-8.2 is now for PHP 8.2.19-dev
2024-03-26 08:51:08 -04:00
Pierrick Charron
6b40a5af09
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  PHP-8.2 is now for PHP 8.2.19-dev
2024-03-26 08:50:36 -04:00
Remi Collet
dd6e738fe4
[ci skip] NEWS for base64_encode 2024-03-26 13:50:31 +01:00
Pierrick Charron
7942268899
PHP-8.2 is now for PHP 8.2.19-dev 2024-03-26 08:49:44 -04:00
Remi Collet
b5446e42b2
add $padding option to base64_encode 2024-03-26 13:45:32 +01:00
Arnaud Le Blanc
412e32d29d Merge branch 'PHP-8.3'
* PHP-8.3:
  Tests are not repeatable
2024-03-26 12:35:40 +01:00
Arnaud Le Blanc
667586bb61 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Tests are not repeatable
2024-03-26 12:35:20 +01:00
Arnaud Le Blanc
bb6b659aa8 Tests are not repeatable
gc_threshold is inherited accross requests, so the tests fail when repeating
2024-03-26 12:33:44 +01:00
Arnaud Le Blanc
c7ca3e5c27 Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip]
  [ci skip]
  Adjust GC threshold if num_roots is higher than gc_threshold after collection (#13758)
2024-03-25 16:24:48 +01:00
Arnaud Le Blanc
ff2359b62e [ci skip] 2024-03-25 16:23:44 +01:00
Arnaud Le Blanc
9a51a7fb30 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip]
  Adjust GC threshold if num_roots is higher than gc_threshold after collection (#13758)
2024-03-25 16:22:54 +01:00
Arnaud Le Blanc
f968a63162 [ci skip] 2024-03-25 16:19:32 +01:00
Arnaud Le Blanc
c13794cdcb
Adjust GC threshold if num_roots is higher than gc_threshold after collection (#13758)
This fixes an edge case causing the GC to be triggered repeatedly.

Destructors might add potential garbage to the buffer, so it may happen that num_root it higher than gc_threshold after collection, thus triggering a GC run almost immediately. This can happen by touching enough objects in a destructor, e.g. by iterating over an array. If this happens again in the new run, and the threshold is not updated, the GC may be triggered again.

The edge case requires specific conditions to be triggered and it must happen rarely in practice:

 * At least GC_THRESHOLD_TRIGGER (100) objects must be collected during each run for the threshold to not be updated
 * At least GC_G(gc_threshold) (initially 10k) objects must be touched (decref'ed to n>0) by any destructor during each run to fill the buffer

The fix is to increase the threshold if GC_G(num_roots) >= GC_G(gc_threshold) after GC. The threshold eventually reaches a point at which the second condition is not met anymore.

The included tests trigger more than 200 GC runs before the fix, and 2 after the fix (dtors always trigger a second run).

A related issue is that zend_gc_check_root_tmpvars() may add potential garbage before the threshold is adjusted, which may trigger GC and exhaust the stack. This is fixed by setting GC_G(active)=1 around zend_gc_check_root_tmpvars().
2024-03-25 16:17:54 +01:00
Alexander M. Turek
ef93086765
DOM stubs: Reference interfaces from the global namespace correctly (#13801) 2024-03-25 12:06:18 +01:00
Jorg Adam Sowa
f69d540541
Removed impossible paths from session_decode and session_encode (#13796) 2024-03-24 20:20:42 +01:00
Niels Dossche
ab8e0b7bf8 Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS
  Fix incorrect check in fpm_shm_free() (#13797)
2024-03-24 13:58:48 +01:00
Niels Dossche
81ae6064ce Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Fix incorrect check in fpm_shm_free() (#13797)
2024-03-24 13:58:41 +01:00
Niels Dossche
e3fbfddbd2 [ci skip] NEWS 2024-03-24 13:58:09 +01:00
Niels Dossche
dd3aa18545
Fix incorrect check in fpm_shm_free() (#13797)
`if (fpm_shm_size - size > 0)` will be rewritten by the compiler as this: `if (fpm_shm_size != size)`, which is undesirable. The reason this happens is that both variables are size_t, so subtracting them cannot be negative. The only way it can be not > 0, is if they're equal because the result will then be 0. This means that the else branch won't work properly. E.g. if `fpm_shm_size == 50` and `size == 51`, then `fpm_shm_size` will wraparound instead of becoming zero.

To showcase that the compiler actually does this, take a look at this
isolated case: https://godbolt.org/z/azobdWcrY. Here we can see the
usage of the compare instruction + cmove, so the "then" branch
is only done if the variables are equal.
2024-03-24 13:57:08 +01:00
Niels Dossche
191d0501a5
Cleanup dom_html_document_encoding_write() (#13788) 2024-03-23 22:17:58 +01:00
Niels Dossche
93d3ae28e1
Remove obsolete OpenSSL code in ext/ftp MINIT (#13793)
Follow-up on GH-13498.
These functions inside this #if block are either deprecated
or do nothing anymore on OpenSSL versions >= 1.1.0.
2024-03-23 19:32:44 +01:00
Ayesh Karunaratne
a4534fafac ext/openssl: Remove kerberos support
Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-03-23 15:12:06 +00:00
Ayesh Karunaratne
3de3e137bf ext/openssl: Bump minimum required OpenSSL version to 1.1.1
Bumps the minimum required OpenSSL version from 1.0.2 to 1.1.1.

OpenSSL 1.1.1 is an LTS release, but has reached[^1] EOL from upstream. However, Linux distro/OS vendors
continue to ship OpenSSL 1.1.1, so 1.1.1 was picked as the minimum. The current minimum 1.0.2 reached
EOL in 2018.

Bumping the minimum required OpenSSL version makes it possible for ext-openssl to remove a bunch of
conditional code, and assume that TLS 1.3 (shipped with OpenSSL 1.1.1) will be supported everywhere.

 - Debian buster: 1.1.1[^2]
 - Ubuntu 20.04: 1.1.1[^3]
 - CentOS/RHEL 7: 1.0.2
 - RHEL 8/Rocky 8/EL 8: 1.1.1
 - Fedora 38: 3.0.9 (`openssl11` provides OpenSSL 1.1 as well)

RHEL/CentOS 7 reaches EOL mid 2024, so for PHP 8.4 scheduled towards the end of this year, we can safely
bump the minimum OpenSSL version.

[^1]: https://www.openssl.org/blog/blog/2023/03/28/1.1.1-EOL/index.html
[^2]: https://packages.debian.org/buster/libssl-dev
[^3]: https://packages.ubuntu.com/focal/libssl-dev
2024-03-23 15:12:06 +00:00
Adam Saponara
0c07b0d94f
Make --enable-embed libs respect --libdir
And make locatable by via `php-config`. Prior to this, `libphp.*`
would always install to `$prefix/lib`. After this, they will install
to `$libdir`.

In practice, this will make it so that programs embedding libphp can
use `php-config` to determine appropriate compile flags without
guessing.

In `configure.ac`, it seems `$libdir` is mutated in some instances.
Ideally the mutated version would be stored in `$phplibdir` or
something. Instead of tracking down all uses of that variable, I
introduced another variable `$orig_libdir` that holds the original
value passed to the configure script.

This is a no-op for users unless they are compiling with `--libdir`
set to something other than `$prefix/lib`, the default.

Closes GH-12389
2024-03-23 07:46:31 +01:00
Peter Kokot
df017cd0ef
Remove unused variable APXS_BINDIR
Last usage removed via d3bc8beb4f.
2024-03-22 16:27:03 +01:00
Niels Dossche
6615476db9 [ci skip] NEWS 2024-03-22 15:01:40 +01:00
Guillaume Outters
bcd3eec44a Fix bug #65106: PHP fails to compile ext/fileinfo
Make data_file.c's generator output its array initialization
"by list of strings", instead of "by list of chars": that makes the compiler
happier.

Use strtr() with a precomputed map, instead of a loop over ord(),
to generate in 1/100th the time.

Avoids ambiguous 0x tokens (as specified in C standards), by using octal.

Closes GH-10422.
2024-03-22 15:00:15 +01:00
haszi
6150bf5ee4
Fix url_rewriter.hosts not used for output_add_rewrite_var()
If fixes issue where session.trans_sid_hosts used instead of
url_rewriter.hosts for output_add_rewrite_var().

Closes GH-13294
2024-03-22 13:57:43 +00:00
Remi Collet
fd28d31fc6
Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS
  [ci skip] NEWS
2024-03-22 11:39:55 +01:00
Remi Collet
c007dca32d
[ci skip] NEWS 2024-03-22 11:39:46 +01:00
Remi Collet
180369216d
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
2024-03-22 11:39:28 +01:00
Remi Collet
6f11cc46e0
[ci skip] NEWS 2024-03-22 11:39:17 +01:00