#37064 [NEW]: mod_ext_filter causes a filtered php page to hang with calls to eval()

From: Date: Thu, 13 Apr 2006 03:51:37 +0000
Subject: #37064 [NEW]: mod_ext_filter causes a filtered php page to hang with calls to eval()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95725@lists.php.net to get a copy of this message
From: jason at merchant dot to Operating system: Windows XP PHP version: 5.1.2 PHP Bug Type: Apache2 related Bug description: mod_ext_filter causes a filtered php page to hang with calls to eval() 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. -- Edit bug report at http://bugs.php.net/?id=37064&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37064&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37064&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37064&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37064&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37064&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37064&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37064&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37064&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37064&r=support Expected behavior: http://bugs.php.net/fix.php?id=37064&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37064&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37064&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37064&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37064&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37064&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37064&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37064&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37064&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37064&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37064&r=mysqlcfg

« previous php.bugs (#95725) next »