Bug #79549 [Ver]: PHP-FPM sends invalid headers '0\xd5e\xc8' to the web server
Edit report at https://bugs.php.net/bug.php?id=79549&edit=1
ID: 79549
User updated by: morozov at tut dot by
Reported by: morozov at tut dot by
Summary: PHP-FPM sends invalid headers '0\xd5e\xc8' to the
web server
Status: Verified
Type: Bug
Package: opcache
Operating System: Linux
PHP Version: 7.4.5
Block user comment: N
Private report: N
New Comment:
> If your application is responsible for emitting that (and given the Content-Length header I
> think it is), it's incorrect behavior [â¦]
FWIW, even with the issue fixed (no Content-* headers and body sent with a 304 response), the issue
is still reproducible.
Previous Comments:
------------------------------------------------------------------------
[2020-05-01 05:41:16] morozov at tut dot by
> Would you be able to try running on other PHP versions? I suggest 7.4.1 and a recent 7.3.
I tried 7.4.1 (also reproducible) and 7.3.17 (not reproducible). Please see the dumps in the updated
gist.
> Separately, notice that this is a 304 but it comes with some output. If your application is
> responsible for emitting that (and given the Content-Length header I think it is), it's
> incorrect behavior that you should look into when you have the time.
Definitely. Thank you for pointing that out.
------------------------------------------------------------------------
[2020-05-01 04:20:30] requinix@php.net
The important bit being
20:47:31.786 >>> process php-fpm [125706 -> 73344] len 152(152)
~Status: 304 Not Modified
X-Powered-By: PHP/7.4.5
Cache-Control: max-age=0, private
j
Pragma:
Content-Length: 2
ort
I've confirmed that whole thing is indeed 152 bytes.
You can take down the gist if you want, but just in case, please dump one of these outputs to a file
and hang onto it in case it's useful.
So yeah, definitely screwy: there's leading garbage before the headers, clearly something weird
happened to the Expires, and there's more garbage before the body.
Would you be able to try running on other PHP versions? I suggest 7.4.1 and a recent 7.3.
Separately, notice that this is a 304 but it comes with some output. If your application is
responsible for emitting that (and given the Content-Length header I think it is), it's
incorrect behavior that you should look into when you have the time.
------------------------------------------------------------------------
[2020-05-01 03:54:33] morozov at tut dot by
Please see the dump at https://gist.github.com/morozov/bfe35ea3298681cf75b6ba54d67d2575
Right before the empty Pragma: header there was supposed to be the Expires: one.
------------------------------------------------------------------------
[2020-05-01 01:44:53] requinix@php.net
I don't know, haven't done it before myself. Some quick leads for you to follow:
https://github.com/mechpen/sockdump
https://superuser.com/questions/484671/can-i-monitor-a-local-unix-domain-socket-like-tcpdump
https://superuser.com/questions/23180/whats-the-easiest-way-to-sniff-tcp-traffic-data-on-linux
------------------------------------------------------------------------
[2020-05-01 01:35:32] morozov at tut dot by
What's the recommended way of intercepting traffic between a web server and PHP FPM? I use a
local Unix socket for development. Should I switch to TCP/IP and use something like Wireshark?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79549
--
Edit this bug report at https://bugs.php.net/bug.php?id=79549&edit=1
Thread (8 messages)