php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37064 mod_ext_filter causes a filtered php page to hang with calls to eval()
Submitted: 2006-04-13 03:51 UTC Modified: 2006-06-28 01:00 UTC
From: jason at merchant dot to Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 5.1.2 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-04-13 03:51 UTC] jason at merchant dot to
Description:
------------
I am using Apache2's mod_ext_filter to modify the output filtering of html and php pages. It works fine on html pages. On php pages with to many calls to eval(), the filter will cause it to hang until the script times out. Within the 30 second timeout my filter was only able to return the first line unmodified.

Reproduce code:
---------------
//********    httpd.conf directives    *************/

ExtFilterDefine myfilter mode=output intype=text/html cmd="C:/php/php.exe C:/myfilter.php"

SetOutputFilter myfilter
/////////////////////////////////////////////////////

//***  C:/myfilter.php(The filter called by php.exe) **/

<?php
$fp = fopen("php://stdin", "r");
while (!feof($fp)) {
   echo fgets($fp);  
}
fclose($fp);
?>
/////////////////////////////////////////////////////

//********  the php page that will be filtered *******/
// This script was copied from a previous bug report with a similar issue in php3 here: http://bugs.php.net/bug.php?id=3744

<?php
       $b = "";
       for ($i = 1; $i < 10000; $i++)
               $b .= "b";
echo "b: $b\n";

       for ($i = 1; $i < 10000; $i++)
       {
echo "i: $i\n"; flush();
               eval("\$a = '$b';");
       }
?>
/////////////////////////////////////////////////////

Expected result:
----------------
when run with the filter turned off I get the expected echoed information.

Actual result:
--------------
The script hangs until it reaches the maximum execution time.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-13 10:29 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-04-13 19:13 UTC] jason at merchant dot to
The link you gave me for the win32 debug packs is broken on http://snaps.php.net/

It is giving php warnings for all the win32 packages.
 [2006-06-20 15:14 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-06-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 02:01:30 2024 UTC