ID:               38950
 Updated by:       [EMAIL PROTECTED]
 Reported By:      pavel dot stratil-jun at fenix dot cz
-Status:           Open
+Status:           Closed
 Bug Type:         *Encryption and hash functions
 Operating System: gentoo (amd64smp)
 PHP Version:      5.1.6
 New Comment:

200MB file is hashed in 3 seconds using hash_file() and in 7 seconds
using streams. The difference is expected because hash_file() uses
static buffer, while hash_update()/fgets() use dynamic buffers.


Previous Comments:
------------------------------------------------------------------------

[2006-09-26 15:28:00] pavel dot stratil-jun at fenix dot cz

on 5.2? well yes and no. the timeout problem disappeared, but  the
timeout itself is still there.

file_hash() does a 200MB file on my machine in about 4 seconds the
checksum

stream hashing times out after half an hour!

and i am not sure if its a performance issue because on smaller files
(anything from bytes to tens of MB) the stream hashing has 60% the
speed of file_hash(), so extrapolating this i would expect a 200MB file
to be hashed in say max 10 seconds, a timeout after 30 minutes is not ok

------------------------------------------------------------------------

[2006-09-26 15:17:42] [EMAIL PROTECTED]

>on php 5.2 after running for 1800 seconds (checked with a
> stopwatch): Fatal error:  Maximum execution time of 1800
> seconds exceeded 

So it does work fine, right?

------------------------------------------------------------------------

[2006-09-26 15:14:54] pavel dot stratil-jun at fenix dot cz

* Reproduce what?
reproduce the timeout error when trying streaming hashing.

* What is the value of max_execution_time?
1800 seconds

* What is the error message? 
on php 5.1.6 after running for about a minute (checked with a
stopwatch): Fatal error:  Maximum execution time of 1800 seconds
exceeded in
/opt/apache/htdocs/hashtest.php on line 58.

on php 5.2 after running for 1800 seconds (checked with a stopwatch):
Fatal error:  Maximum execution time of 1800 seconds exceeded in
/opt/apache/htdocs/hashtest.php on line 58.


My totally naive guess is that during the while loop the eof might not
be properly recognised (on both versions) or that the loop itself has
some counter which for some reason signals to php that the script timed
out even if it didnt.

------------------------------------------------------------------------

[2006-09-26 14:24:44] [EMAIL PROTECTED]

Reproduce what? What is the value of max_execution_time? What is the
error message? What is the real amount of time spent and how did you
measure it?

------------------------------------------------------------------------

[2006-09-26 14:19:35] pavel dot stratil-jun at fenix dot cz

I cant find the rule in the problem. I was able to reproduce it always
on files > 1.2GB. I could reproduce it sometimes on files ranging from
70MB to 1.2GB and I havent been able to reproduce on files < 70MB.

------------------------------------------------------------------------

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
    http://bugs.php.net/38950

-- 
Edit this bug report at http://bugs.php.net/?id=38950&edit=1

Reply via email to