#18740 [NEW]: Binary output corrupted
| From: | tom at sillence dot co dot uk | Date: | Mon, 05 Aug 2002 10:24:20 +0000 |
| Subject: | #18740 [NEW]: Binary output corrupted | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-16004@lists.php.net to get a copy of this message | ||
From: tom@sillence.co.uk
Operating system: Suse Linux 7.3
PHP version: 4.2.2
PHP Bug Type: Output Control
Bug description: Binary output corrupted
Note: I think this bug may be related to #17885, but I am using Apache
1.3.20, not Apache2.
Any script outputting a zipfile intermittently generates corrupt output. I
can't work out what factors influence when it does and when it doesn't.
I have tried everything from:
readfile("test.zip");
to
$fp = fopen("test.zip", "rb");
$data = fread($fp, 100000); //the zip is < 100kb
fclose($fp);
$md5 = md5($data);
for($i=0; $i < strlen($data); $i += 100)
{
echo substr($data, $i, min(100, strlen($data)-$i));
}
$fp = fopen("logfile", "a");
fwrite($fp, "served $filename: $md5\n");
fclose($fp);
The above script logs the md5 hash of the data read in. The value logged
does not change whether or not the output was corrupt, suggesting that the
bug is in the output not the file reading.
I am not able to test on different OSs or apache versions, but the problem
IS new since php4.1.2.
My configure line is: --with-apxs --with-zip --with-zlib
--with-sybase=/usr/local/freetds
I've temporarily moved my zip-reading code to a bit of cgi perl which is
working fine.
--
Edit bug report at http://bugs.php.net/?id=18740&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18740&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18740&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18740&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18740&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18740&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18740&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18740&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18740&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18740&r=globals