ID:               25266
 Updated by:       [EMAIL PROTECTED]
 Reported By:      avarnals at zigg dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         Apache2 related
 Operating System: Linux 2.4.21
 PHP Version:      4CVS-2003-12-15
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip




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

[2004-01-04 15:24:33] avarnals at zigg dot net

I have repeated the first test with php4-STABLE-200401041830 as an
Apache module. The result is the same as before, i.e. the problem
hasn't gone.

Have you tested this yourself or are just asking me to re-try it every
time there is a new PHP 4 'latest' version?

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

[2004-01-04 14:17:00] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



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

[2003-12-15 19:21:31] avarnals at zigg dot net

I have just repeated the first simple test using
php4-STABLE-200312152230 and Apache 2.0.48, with PHP loaded as an
Apache module.

The bug has not gone. I.e. the httpd process continues to run the
script ( until halted by the PHP time limit ) after the browser's stop
button has been used.

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

[2003-08-26 22:05:10] avarnals at zigg dot net

Description:
------------
See bug #22072.

Since the above is now closed, I am creating this entry. Please accept
my apologies if it would have been better added to 22072 instead.

I wasn't aware of this potential problem until I saw it in the change
log for 4.3.3, so I thought I'd test it. Something is still not right.
I'm using PHP 4.3.3 with Apache 2.0.47.

My first test was to see whether ignore_user_abort() works as expected.
I used the very simple:

  ignore_user_abort ( false );
  while ( 1 );

This makes it easy to spot in the process list using 'top'. I tested
both using PHP as a dynamically loaded Apache module and the CGI
binary. The latter had safe mode enabled, the former didn't; I don't
know whether this can/should make any difference. In both cases the
script continued to execute after I clicked on the browser's stop
button and until its PHP enforced time limit was reached.

I then went on to test ( using only the Apache module ) using the code
suggested in bug report 22072:

  http://www.mpfreescene.com/test/?option=source

As rather expected now, this continued to execute after I'd used the
stop button.

I went on to test by modifying the code as follows:

  - I set set_time_limit(15); so it would eventually be
      aborted by this limit.
  - I made $m very large.
  - Have the result of connection_status() written to a
      file each time round the loop.
  - I removed the sleep() call.

I ran the script and used the stop button while it was running. It
continued to execute until it had used 15 seconds of CPU time. Log file
shows: httpd: PHP Fatal error:  Maximum execution time of 15 seconds
exceeded in...
The final ( large ) output file contained all zeros and a final 2.

So, it seems that PHP correctly detects and reports the case of a
timeout, but not an abort.

I noticed one other possibly odd thing while doing this. If PHP has
output buffering enabled, the call to flush() results in the script
being immediately shut down ( execution doesn't get to the line
following flush() ). The result of connection_status() when called in
exitfp() is then 1. If the flush() call is removed, the results as
previously described are the same whether or not output buffering is
enabled.

I hope someone can make sense of all this! Do let me know if you would
like any further information.




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


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

Reply via email to