Commit Graph

5714 Commits

Author SHA1 Message Date
Christoph M. Becker
aef7d810d3
Fix GH-9949: Partial content on incomplete POST request
`ap_get_brigade()` may fail for different reasons, and we must not
pretend that a partially read POST payload is fine; instead we report
a content length of zero what matches all other `read_post()` callbacks
of bundled SAPIs.

Closes GH-10059.
2022-12-13 15:21:42 +01:00
Jakub Zelenka
c9c1934ff0
Fix GH-8517: FPM child pointer can be potentially uninitialized
There might be a moment when the child log event is executed after
freeing a child. That could possibly happen if the child output is
triggered at the same as the terminating of the child. Then the output
event could be potentially processed after the terminating event which
would cause this kind of issue.

The issue might got more visible after introducing the log_stream on
a child because it is more likely that this cannot be dereferenced
after free. However it is very hard to reproduce this issue so there
is no test for this.

The fix basically prevents passing a child pointer and instead passes
the child PID and then looks the child up by the PID when it is being
processed. This is obviously slower but it is a safe way to do it and
the slow down should not be hopefully visible in a way that it would
overload a master process.
2022-11-23 11:25:51 +00:00
Jakub Zelenka
5a4520bc2b
Fix bug #68207: Setting fastcgi.error_header can result in a WARNING 2022-11-22 18:17:16 +00:00
Jakub Zelenka
31b20f1737
Merge branch 'PHP-8.0' into PHP-8.1 2022-11-22 18:02:11 +00:00
Petr Sumbera
72da2b02e2
php-fpm: fix Solaris port events.mechanism
Closes GH-9959.
2022-11-22 18:01:15 +00:00
George Wang
aee1a2f4c0 Merge branch 'PHP-8.0' into PHP-8.1 2022-11-20 19:30:25 -05:00
George Wang
4bdfce6c1a Use __atomic_xxxx() instead of __sync_xxxx() for lsapi. 2022-11-20 19:30:07 -05:00
Jakub Zelenka
b8c1b5e9fa Merge branch 'PHP-8.0' into PHP-8.1 2022-11-13 19:06:10 +00:00
Jakub Zelenka
db2d32f476 Introduce TEST_FPM_EXTENSION_DIR for FPM tests with shared extensions 2022-11-13 19:04:43 +00:00
Jakub Zelenka
a04a021105
Merge branch 'PHP-8.0' into PHP-8.1 2022-10-30 17:02:08 +00:00
Jakub Zelenka
8229649045
Fix GH-9770: Add small timeout in status-listen test
This is to allow more time to switch for active to idle in scoreboard as
it seems that Travis is quite short on resources and might not switch it
quickly enough.
2022-10-30 17:00:40 +00:00
Jakub Zelenka
29f7c4613e
Merge branch 'PHP-8.0' into PHP-8.1 2022-10-30 11:43:11 +00:00
Jakub Zelenka
1c5844aa3e
Fix GH-9754: SaltStack hangs when running php-fpm 8.1.11
SaltStack uses Python subprocess and redirects stderr to stdout which is
then piped to the returned output. If php-fpm starts in daemonized mode,
it should close stderr. However a fix introduced in GH-8913 keeps stderr
around so it can be later restored. That causes the issue reported in
GH-9754. The solution is to keep stderr around only when php-fpm runs in
foreground as the issue is most likely visible only there. Basically
there is no need to restore stderr when php-fpm is daemonized.
2022-10-30 11:41:33 +00:00
Ilija Tovilo
6be8efdf78
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix cli server blocking on accept when using multiple workers
2022-10-20 13:04:14 +02:00
Ilija Tovilo
d52f0451ad
Fix cli server blocking on accept when using multiple workers
Fixes GH-9400
Closes GH-9693
2022-10-20 13:03:35 +02:00
Jakub Zelenka
6d005c2cec
Merge branch 'PHP-8.0' into PHP-8.1 2022-09-29 15:30:27 +01:00
Jakub Zelenka
8e1cef4341
Do not check X-Powered-By header in FPM tester if expose_php off
Closes GH-9508
2022-09-29 15:27:33 +01:00
Jakub Zelenka
1ed4303957
Improve CS in FPM Tester Response 2022-09-29 15:24:00 +01:00
Jakub Zelenka
54cb2cdcd3
Merge branch 'PHP-8.0' into PHP-8.1 2022-09-27 17:31:08 +01:00
Jakub Zelenka
1e8fa6607d
Rework FPM tests logging for better debugging 2022-09-27 17:27:43 +01:00
Jakub Zelenka
bf97b3649d
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 22:33:02 +01:00
Jakub Zelenka
3503b1daa2
Fix bug #77780: "Headers already sent" when previous connection was aborted
This change primarily splits SAPI deactivation to module and destroy
parts. The reason is that currently some SAPIs might bail out
on deactivation. One of those SAPI is PHP-FPM that can bail out on
request end if for example the connection is closed by the client
(web sever). The problem is that in such case the resources are not
freed and some values reset. The most visible impact can have not
resetting the PG(headers_sent) which can cause erorrs in the next
request. One such issue is described in #77780 bug which this fixes
and is also cover by a test in this commit. It seems reasonable
to separate deactivation and destroying of the resource which means
that the bail out will not impact it.
2022-08-29 22:25:53 +01:00
Jakub Zelenka
7dc3d4b510
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 16:42:58 +01:00
Jakub Zelenka
986e7319c5
Re-add fixed tests for GH-8885 2022-08-29 16:42:10 +01:00
Jakub Zelenka
36063873b0
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 16:41:19 +01:00
Jakub Zelenka
bcdd9877e1 Fix GH-8885 tests on MacOS 2022-08-29 16:40:31 +01:00
Jakub Zelenka
be45f540ee
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 14:40:57 +01:00
Dmitry Menshikov
f92505cf24
Fix GH-8885: access.log with stderr writes logs to error_log after reload
This fix allows restoring the the original stderr so the logs are
correctly written.
2022-08-29 14:39:24 +01:00
David Carlier
819df032aa Merge branch 'PHP-8.0' into PHP-8.1 2022-08-28 23:33:17 +01:00
David Carlier
e2a5428ca0 FPM fix strict prototype warnings.
Closes GH-8986.
2022-08-28 23:24:23 +01:00
David CARLIER
9a8ae45c4b Revert "FPM: Downgrade occasional "failed to acquire scoreboard" warning"
This reverts commit 3040f75f43.
2022-07-18 14:21:54 +01:00
David CARLIER
2a5b2cca85 Revert "FPM: Downgrade occasional "failed to acquire scoreboard" warning"
This reverts commit 3040f75f43.
2022-07-18 14:21:07 +01:00
David Carlier
edb173c200 Merge branch 'PHP-8.0' into PHP-8.1 2022-07-18 12:40:47 +01:00
Felix Wiedemann
3040f75f43 FPM: Downgrade occasional "failed to acquire scoreboard" warning
With request timeouts configured, php-fpm occasionally prints the
following warning:

   WARNING: failed to acquire scoreboard

This is happens when php-fpm checks the child scoreboards for timeouts,
but fails to acquire a lock immediately.  As this can (and does) occur
during normal operation, this commit downgrades this to a notice.
Closes #9019.
2022-07-18 12:40:16 +01:00
David Carlier
b44a17c02a Merge branch 'PHP-8.0' into PHP-8.1 2022-07-14 12:13:21 +01:00
guoyiyuan
789a37f144 Prevent potential buffer overflow for large value of php_cli_server_workers_max
Fixes #8989.
Closes #9000.
2022-07-14 12:12:25 +01:00
Arnaud Le Blanc
2dbde18b29
Fix GH-8952: std streams can not be deliberately closed (#8953) 2022-07-09 22:58:02 +02:00
David Carlier
9b5a2635d6 Merge branch 'PHP-8.0' into PHP-8.1 2022-07-08 13:12:30 +01:00
Heiko Weber
bd6793372b FPM: Fix possible double free on configuration load failure.
Closes #8948.
2022-07-08 13:11:37 +01:00
David Carlier
26d63c74be Merge branch 'PHP-8.0' into PHP-8.1 2022-07-01 05:34:05 +01:00
David Carlier
b3569865b3 Fix the crypt sha apis build (with recent clang versions).
Removing the said subtraction by casting instead.
While at it fixing werror level on phpdbg too.

Closes #8897.
2022-07-01 05:33:12 +01:00
David Carlier
3eead43b6d Merge branch 'PHP-8.0' into PHP-8.1 2022-06-27 23:36:05 +01:00
Heiko Weber
325ca31dcf FPM: zlog, fix free on wrong address for message prepend. 2022-06-27 23:34:58 +01:00
Christoph M. Becker
b8dee9b3fc
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8827: Intentionally closing std handles no longer possible
2022-06-20 18:04:34 +02:00
Christoph M. Becker
a8437d08a8
Fix GH-8827: Intentionally closing std handles no longer possible
We revert the commits which caused this regression from the PHP-8.0 and
PHP-8.1 branches for now.  We keep it in "master" because of PR #8833
which may offer a proper fix without BC break.
2022-06-20 18:01:02 +02:00
Jakub Zelenka
b3e6faed48
Merge branch 'PHP-8.0' into PHP-8.1 2022-06-19 20:09:37 +01:00
Jakub Zelenka
e330f443c9
Fix bug #67764: fpm: syslog.ident does not work 2022-06-19 20:05:49 +01:00
David Carlier
75743eaf1b Merge branch 'PHP-8.0' into PHP-8.1 2022-06-16 12:41:51 +01:00
Heiko Weber
a83363e361 FPM: Fix use after free in fpm_evaluate_full_path
Closes #8796.
2022-06-16 12:18:01 +01:00
Levi Morrison
ffd27bdec4 Stop closing stderr and stdout streams (#8570)
Extensions may (and do) write to stderr in mshutdown and similar. In
the best case, with the stderr stream closed, it's just swallowed.

However, some libraries will do things like try to detect color, and
these will outright fail and cause an error path to be taken.
2022-05-20 13:40:09 +02:00