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

>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?


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

[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.

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

[2006-09-26 12:59:18] [EMAIL PROTECTED]

>but streaming hashing still fails on large files (the 
>script timeouts for real after max_execution_time even on
> relatively small files, compared to the first tests - i.e.
>200MB)

Please elaborate.

>many compile failures when trying to build with some
> common extensions such as imap (against imap2006) or
> mysqli (5.1.11).

Please report them as separate issues.

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

[2006-09-26 12:45:31] pavel dot stratil-jun at fenix dot cz

seems that the problem is in

    $fp = fopen('test', "r");
    $ctx = hash_init('sha512');
    while (!feof($fp)) {
        hash_update($ctx, fgets($fp, 4096));
    }
    $uplo_mhash = hash_final($ctx);
    fclose($fp);

when calling the script from apache. When running from shell the
problem disappears completely. In apache the premature timeout problem
disappeared in the snapshot version, but streaming hashing still fails
on large files (the script timeouts for real after max_execution_time
even on relatively small files, compared to the first tests - i.e.
200MB). Hash_file() seems to work flawlesly. When going towards smaller
files, streaming hashing catches on and is about 60% the speed of
hash_file.

Tried this with apache 2.2.2 and 2.2.3 with modified as well as
distribution configurations with the same result.


tested on 
php5.2-200609261030
./configure --prefix=${PHP_PATH} --with-apxs2=${APACHE_PATH}/bin/apxs
gmake      # ok
gmake test # failed in 4 tests

# Test for buffering in core functions with implicit flush off
[tests/func/008.phpt]
# Bug #16069 [ext/iconv/tests/bug16069.phpt]
#iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
# Math constants [ext/standard/tests/math/constants.phpt]

ps: dont know how far the development of php 5.2 is but i was getting
many compile failures when trying to build with some common extensions
such as imap (against imap2006) or mysqli (5.1.11).

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

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