1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

1485 Commits

Author SHA1 Message Date
Ilija Tovilo
6f17c693ef Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix RC assertion in fpm when php_admin_value setting fails
2025-09-03 14:50:15 +02:00
Ilija Tovilo
15beb140e5 Fix RC assertion in fpm when php_admin_value setting fails
The value is temporarily duplicated. While the value is allocated persistently,
it will be freed if the ini value can't be set. This is safe, given the value
has not actually been stored.

Exposed by GH-19619
Closes GH-19671
2025-09-03 14:49:06 +02:00
Niels Dossche
b57578f3b1 Fix GH-19383: php-8.3.24: Missing type in function definition: fpm_event_kqueue_clean
This is just a clean backport.
2025-08-10 13:25:24 +02:00
Jakub Zelenka
39efe8ac1e Merge branch 'PHP-8.3' into PHP-8.4 2025-05-30 22:57:34 +02:00
txuna
48b492269b Fix GH-18595: fpm_get_status segfault
This fixes null dereference error when calling fpm_get_status() and one
of the children is just being created.

Closes GH-18662

Co-authored-by: Jakub Zelenka <bukka@php.net>
2025-05-30 22:55:53 +02:00
Arnaud Le Blanc
995f11adb1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Disable ZEND_RC_MOD_CHECK() while loading shared extension in FPM
2025-03-17 17:40:23 +01:00
Arnaud Le Blanc
c531f3d79b Disable ZEND_RC_MOD_CHECK() while loading shared extension in FPM
This fixes a ZEND_RC_MOD_CHECK() assertion failure when building with
"-DZEND_RC_DEBUG=1 --enable-debug --enable-zts". php_dl() is called after
startup, and manipulates the refcount of persistent strings, which is not
allowed at this point of the lifecycle.

The dl() function disables the ZEND_RC_MOD_CHECK() assertion before calling
php_dl(). This change applies the same workaround in FPM.

Closes GH-18075
2025-03-17 17:40:05 +01:00
Jakub Zelenka
74d4e67236 Merge branch 'PHP-8.3' into PHP-8.4 2025-02-08 12:07:22 +01:00
Jakub Zelenka
e48ceb0026 Fix GH-17643: FPM with httpd ProxyPass encoded PATH_INFO env
Closes GH-17644
2025-02-08 12:05:25 +01:00
Niels Dossche
2161959834 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17208: bug64539-status-json-encoding.phpt fail on 32-bits
2024-12-27 21:48:52 +01:00
Niels Dossche
847d1401a0 Fix GH-17208: bug64539-status-json-encoding.phpt fail on 32-bits
The reason this breaks is because of a type mismatch.
The following line uses fields of the timeval struct which are both 8 bytes on
Alpine 32-bit, which results in a computed value of also 8 bytes:
b09ed9a0f2/sapi/fpm/fpm/fpm_status.c (L611)

However, it is passed to a format string which expects 4 bytes
(`unsigned long` and thus the `%lu` format specifier is 4 bytes on Alpine 32-bit),
resulting in argument corruption.
Since the value is generally small, truncating to 4 bytes is sufficient to fix this.

Closes GH-17286.
2024-12-27 21:48:15 +01:00
Christoph M. Becker
0285e9a868 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Include relevant system headers before defining fallbacks
2024-12-22 16:30:04 +01:00
Christoph M. Becker
fcbfd5a680 Include relevant system headers before defining fallbacks
Otherwise we may define the fallbacks, and later inclusion of the
system headers may attempt to redefine those.

Fixes GH-17112.
Closes GH-17129.
2024-12-22 16:27:01 +01:00
Jakub Zelenka
c4c536da4c Merge branch 'PHP-8.3' into PHP-8.4 2024-12-22 14:58:08 +01:00
Jakub Zelenka
e0b79cdc5c Introduce FPM_TEST_DEBUG_FILTER env var and extend multi request tracing 2024-12-22 14:15:03 +01:00
Jakub Zelenka
0cc0c7c7d9 Merge branch 'PHP-8.3' into PHP-8.4 2024-12-14 15:01:17 +01:00
Jakub Zelenka
3490ac0cb3 Fix GH-13437: FPM: ERROR: scoreboard: failed to lock (already locked)
This changes locking for scoreboard to reduce contention between readers
and adds retries for acquiring scoreboard for read.

Closes GH-15805
2024-12-14 14:59:56 +01:00
Jakub Zelenka
d165670d04 Fix GH-16932: wrong FPM status output
Closes GH-16974

Co-authored-by: James Lucas <james@lucas.net.au>
2024-11-28 08:59:55 +01:00
Jakub Zelenka
49bc011c9f Merge branch 'PHP-8.3' into PHP-8.4 2024-11-08 16:50:41 +01:00
Jakub Zelenka
af8ebb12ca Merge branch 'PHP-8.2' into PHP-8.3 2024-11-08 16:48:25 +01:00
Jakub Zelenka
065bde1e13 Fix GH-16432: PHP-FPM 8.2 SIGSEGV in fpm_get_status 2024-11-08 16:44:05 +01:00
Niels Dossche
2f5021b6bd Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix test with shared zend_test (#16705)
2024-11-05 21:36:48 +01:00
Niels Dossche
9a255b384f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix test with shared zend_test (#16705)
2024-11-05 21:36:41 +01:00
Niels Dossche
3f1ea1b663 Fix test with shared zend_test (#16705) 2024-11-05 21:35:47 +01:00
Niels Dossche
bfd9e0cca3 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16628: FPM logs are getting corrupted with this log statement
  Fix GH-16601: Memory leak in Reflection constructors
2024-11-02 19:38:54 +01:00
Niels Dossche
16cda10650 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16628: FPM logs are getting corrupted with this log statement
  Fix GH-16601: Memory leak in Reflection constructors
2024-11-02 19:37:28 +01:00
Niels Dossche
e643129bbb Fix GH-16628: FPM logs are getting corrupted with this log statement
zlog_buf_prefix() can return a larger length than what actually was
written due to its use of snprintf(). The code in
zlog_stream_prefix_ex() does not take this into account, other callers
do. What ends up happening then is that stream->length is set to the
length as if snprintf() was able to write all bytes, causing
stream->length to become larger than stream->buf.size, causing a
segfault.

In case the buffer was too small we try with a larger buffer up to a
limit of zlog_limit. This makes sure that the stream length will remain
bounded by the buffer size.

This also adds assertions to make the programmer intent clear and catch
this more easily in debug builds.

Closes GH-16680.
2024-11-02 19:36:20 +01:00
Jakub Zelenka
ee7e21020e Fix FPM tester params type 2024-10-06 21:26:42 +01:00
Jakub Zelenka
10d2d862a6 Merge branch 'PHP-8.3' into PHP-8.4 2024-10-06 19:43:19 +01:00
Jakub Zelenka
59816b9a73 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-06 19:40:24 +01:00
Jakub Zelenka
5a47f27021 Fix GH-15395: php-fpm: zend_mm_heap corrupted with cgi-fcgi request
Closes GH-16227

Co-authored-by: David Carlier <devnexen@gmail.com>
2024-10-06 19:37:55 +01:00
Ben Ramsey
d854a54b5f Merge branch 'PHP-8.3' into PHP-8.4 2024-09-26 14:24:13 -05:00
Ben Ramsey
6d99ccc268 Merge branch 'PHP-8.2' into PHP-8.3 2024-09-26 14:13:00 -05:00
Ben Ramsey
c259c9f3f6 Merge branch 'PHP-8.1' into PHP-8.2 2024-09-26 13:13:46 -05:00
Jakub Zelenka
4580b8b3e1 Fix GHSA-865w-9rf3-2wh5: FPM: Logs from childrens may be altered 2024-09-23 11:24:35 +01:00
Michael Voříšek
d313ad6098 Deprecate E_STRICT constant and remove error level
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant

Closes GH-13053
2024-09-18 14:33:14 +02:00
Peter Kokot
13f041163c Remove Travis artefacts (#15714)
Travis was suspended https://github.com/php/php-src/pull/15314

This removes 404 errored Travis image in README, travis configuration
directory and YAML file and usages in tests.

[skip ci]

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-09-04 01:15:10 +02:00
Peter Kokot
1a126c540a Autotools: Normalize flags arguments (#15671)
This is a follow up of 7edb9a07d7 that
provides passing compilation options to PHP_NEW_EXTENSION,
PHP_ADD_SOURCES, PHP_ADD_SOURCES_X, and PHP_SELECT_SAPI as a
blank-or-newline-separated argument.
2024-09-01 01:02:40 +02:00
Peter Kokot
fbacc0f936 Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)
The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
2024-08-29 00:44:29 +02:00
Orlando Thöny
9c267778d2 FPM: Remove usage of non-existing MAX_LINE_LENGTH constant (#5634) 2024-08-24 15:26:58 +01:00
Flavio Heleno
67aac59cfc Add PHP-FPM memory peak to the scoreboard
Closes #14153
2024-08-24 15:25:18 +01:00
Peter Kokot
4f4794b12d Autotools: Sync CS in fpm SAPI (#15412)
- AS_* macros used
- obsolete backticks replaced with $(...)
- redundant double quotes removed
2024-08-15 11:39:09 +02:00
Peter Kokot
53d6ed8a6b Autotools: Fix typo in FPM TCP_CONNECTION_INFO check (#15411)
Otherwise, the check even works with such typo, but this fixes the
TCP_CONNECTION_INFO check on macOS machines for FPM.
2024-08-14 20:05:18 +02:00
Remi Collet
40d88cacc1 Fix test expectation for "Built by..." (#15383) 2024-08-13 21:58:44 +01:00
Calvin Buckley
afc5738154 Show build provider and unify version information printing (#14657)
* Show build provider information in "php -v"

Vendors such as distributions can set the `PHP_BUILD_PROVIDER`
variable, that gets printed in phpinfo. However, I find that users check
`php -v` more often than phpinfo to see what PHP they're running. The
problem with this is that it does not show that build provider
information.

This change makes the build provider information printed on an
additional line of the version information.

* Put on same line so it works with or without env var

Unbreaks build without PHP_BUILD_PROVIDER set.

* change wording in provider version text

better grammatically; many different possibilities here though

* Unify SAPI version printing

This makes it so that all of the SAPIs share the same code for printing
version information. This is useful in case of any future changes to the
version information, such as i.e. adding build provider to the output.

* Make include for php_print_version explicit

* Preserve phpdbg version and output channel

php_printf doesn't have same semantics, as phpdbg_out could be on a
different output than stdout/err. Also add the phpdbg version (in case
it differs from PHP's, to keep similar output before this PR)

* remove size variables

we don't use them and CI doesn't like unused variables

* Fix format string insecurity
2024-08-12 23:24:41 -03:00
Peter Kokot
9fcc1bca8a Remove redundant middle newlines in "Autotools" related files
This syncs few minor left-overs in "Autotools" related files:
- redundant middle newlines removed (in man pages the duplicate newlines
  are also ignored and are not visible in the man page anyway)
- Minor mixed indentation synced

[skip ci]
2024-08-12 13:18:32 +02:00
Peter Kokot
dcdcb3cbfe Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE (#15209)
This replaces the AC_MSG_ERROR with AC_MSG_FAILURE, where appropriate.

The AC_MSG_ERROR outputs given message and exits the configure step. The
AC_MSG_FAILURE does the same but also automatically outputs additional
message "See 'config.log' for more details." which might help directing
the user where to look further.

The AC_MSG_ERROR is used for errors where current test step isn't logged
in the config.log and wouldn't make sense, and AC_MSG_FAILURE is mostly
used in cases of library checks, compilation tests, headers checked with
AC_CHECK_HEADER* and similar tests that are also logged in the
config.log.

AC_MSG_ERROR([Sanity check failed.]) output:

```
configure: error: Sanity check failed.
```

AC_MSG_FAILURE([Sanity check failed.]) output:

```
configure: error: in '/path/to/php-src':
configure: error: Sanity check failed.
See 'config.log' for more details
```
2024-08-04 07:36:37 +02:00
Peter Kokot
4f07cdc584 Replace PHP_OUTPUT with AC_CONFIG_FILES (#15186)
This is a follow-up of GH-15177
(c96f08aa70)
and GH-15185
(9467ffb43c)

The PHP_OUTPUT macro was introduced in the very early phase of the build
system due to AC_OUTPUT handling issues in the old Autoconf versions
before the AC_CONFIG_FILES, AC_CONFIG_COMMANDS etc were introduced with
the AC_OUTPUT signature without arguments. The PHP_OUTPUT was also
helping Makefile.in back then being properly generated based on whether
all files were generated or only some (when using the obsolete
CONFIG_FILES=... ./config.status invocation instead of the new
./config.status --file=...). Another issue is that PHP_OUTPUT can't be
used by extensions when using phpize.

This replaces the PHP_OUTPUT invocations with default AC_CONFIG_FILES.

The obsolete "REDO_ALL" feature at the config.status invocation is also
removed with a simpler unconditional generation.

In phar extension the "ext/phar" is replaced with $ext_dir variable to
be able to use phpize.
2024-08-03 21:52:14 +02:00
Peter Kokot
c96f08aa70 Autotools: Normalize PHP_OUTPUT arguments (#15177)
The m4_normalize([$1]) normalizes items into a single-space-separated
list of files to append them to the global PHP_OUTPUT_FILES variable
that is processed by AC_CONFIG_FILES. Redundant newlines are also
removed in the generated configure script.

PHP extensions using phpize can't use this macro so it's safe to change
this.
2024-08-01 00:14:56 +02:00
Peter Kokot
003e238436 Autotools: Quote and fix PHP_SELECT_SAPI arguments (#15118)
This macro once had also the 5th argument (the build target), which was
removed via 2a6da0f24c. This quotes all
PHP_SELECT_SAPI arguments and removes the redundant ones. The basic
macro usage help text is moved to the macros section from the obsolete
docs file.
2024-07-27 22:46:36 +02:00