php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18740 Binary output corrupted
Submitted: 2002-08-05 06:24 UTC Modified: 2002-09-11 11:49 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: tom at sillence dot co dot uk Assigned:
Status: No Feedback Package: Output Control
PHP Version: 4.2.2 OS: Suse Linux 7.3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tom at sillence dot co dot uk
New email:
PHP Version: OS:

 

 [2002-08-05 06:24 UTC] tom at sillence dot co dot uk
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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-05 07:14 UTC] yohgaki@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

This may be fixed in CVS already.
Please reopen if problem exists in 4.3.0-dev.

 [2002-09-11 11:49 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 16:01:29 2024 UTC