ID: 44749 Updated by: [EMAIL PROTECTED] Reported By: eth at ethaniel dot com -Status: Open +Status: Bogus Bug Type: CGI related Operating System: Freebsd 7.0 PHP Version: 5.2.5 New Comment:
Your problem is: (with _suhosin_ patch). Previous Comments: ------------------------------------------------------------------------ [2008-04-17 10:59:10] eth at ethaniel dot com server.network-backend = "write" started causing some strange "resource unavailable" errors in the error log, so I changed it to server.network-backend = "writev" and everything went back to normal. ------------------------------------------------------------------------ [2008-04-17 08:58:15] eth at ethaniel dot com Seems like the problem was in lighttpd. Setting server.network-backend = "write" in lighttpd.conf solved the problem. ------------------------------------------------------------------------ [2008-04-16 21:31:05] eth at ethaniel dot com Description: ------------ I use Freebsd 7.0 with lighttpd 1.4.19 and php-cgi 5.2.5 (with suhosin patch). I noticed, that when I do a large upload (1.2 megabytes) php works unadequately: randomly it either corrupts the upload or just freezes. So for instance, if I run php-cgi on a tcp port (1026) it successfully accepts all uploads that are given to it from lighttpd and processes them through the script. But randomly (sometimes several times in a row, sometimes one out of 10 requests) it corrupts the post data (several bytes in the center of the 1.2 megabyte block get corrupted - replaced with 00 00 00 hex values). Nothing freezes at this configuration. If I run php-cgi as a unix socket (/tmp/php.sock) it either accepts the upload (and never shows any sign of corruption, all data is processed normally), or just halts and leaves the connection open (doesn't reply to the current and any new connections either). Sometimes it just unfreezes after a while and starts accepting new connections, sometimes I just have to respawn php-cgi. My best guess is that it might have something to do with the freebsd 7.0 socket handling. Maybe not - maybe it really is a bug in php-cgi. I checked - lighttpd has all the uploaded files uncorrupted. The bad things start happening somewhere between lighttpd and fastcgi php. Reproduce code: --------------- Here is the command I use to make the upload from the remote host. curl -vv -# -s -F "[EMAIL PROTECTED]" -H "Host: upload.host.ru" -H "Expect:" -H "Content-Type:" -0 1.1.1.1:200/testupload.php Note the empty Content-type - once I noticed the corruption, I decided to make a test and debug HTTP_RAW_POST_DATA by hand. The corruption was all the way up there. Expected result: ---------------- The testupload.php script checks the HTTP_RAW_POST_DATA, extracts the uploaded files from mime headers and checks it's md5 value. If MD5 is incorrect, it logs the uploaded file and then I compare it to the normal sample. Actual result: -------------- Nothing here. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44749&edit=1
