#37204 [Bgs-Opn]: Can cause open-ended exception bomb
ID: 37204 User updated by: mailslot at mac dot com Reported By: mailslot at mac dot com -Status: Bogus +Status: Open Bug Type: Reproducible crash Operating System: Linux 2.4.21-9.EL PHP Version: 5.1.2 New Comment: No. They really aren't. I don't have 2GB RAM set in the config file. Previous Comments: [2006-04-26 07:25:18] [EMAIL PROTECTED] These values are completely ignored during recursion bombs. They ARE respected. [2006-04-26 04:58:26] mailslot at mac dot com Okay... no recursion limits. Fine. I'd rather have to enable dangerous recursion levels, but I can live without it. I still think this bug is valid. Could you please respect the configuration defines that set limits for script execution time and memory usage? These values are completely ignored during recursion bombs. Surely that's not expected behavior. If they worked as advertised, this bug would never have even manifested itself. [2006-04-26 03:13:56] judas dot iscariote at gmail dot com the recursion Limit problem is well known (for years), and there is no solution at this time.( because solution should be adecuate for any legitimate use, not just for average use) Use Xdebug to set a recursion limit in your dev enviroment. [2006-04-26 00:45:04] mailslot at mac dot com Description: I encountered this problem while debugging an exception logging class. Infinite recursion problems are a coding mistake, but I've never seen one take down Apache before. Apache will grow in size until virtual memory starts swapping. The CPU will be at 100% and eventually, appears to halt. Limits, obviously, are not being used... yet. Reproduce code: --- ?php class Eggception extends Exception { public function __construct($ex) { parent::__construct($ex); try { // let's say that a database object throws derived Eggception throw new EggceptionSubclass('It happens'); // this is valid (not infinitely recursive) //throw new Exception('It happens'); } catch (Exception $e) { // should swallow exception, right? // not before a never-ending recursive bomb } } } class EggceptionSubclass extends Eggception {} // the following causes a runaway process (memory leak // CPU spike) with Apache 2.0.55 and PHP 5.1.2 // rather quickly, all server resources become exhausted // without proper process limits, potentially crashing the // entire machine. throw new Eggception('Exception Bomb'); ? Expected result: A timeout after a large CPU spike... perhaps a stack overflow error. An exception recursion counter that kills a script whenever it's 1,000 layers deep in an exception stack... that would be great. Actual result: -- The process (PHP or Apache, depending on which are used to execute the script) will consume as much memory allowed while pegging the CPU at 100% utilization. Kill -9 works fine. Workarounds include ulimit and softlimit. -- Edit this bug report at http://bugs.php.net/?id=37204edit=1
#37204 [Bgs]: Can cause open-ended exception bomb
ID: 37204 User updated by: mailslot at mac dot com Reported By: mailslot at mac dot com Status: Bogus Bug Type: Reproducible crash Operating System: Linux 2.4.21-9.EL PHP Version: 5.1.2 New Comment: Never-mind. I'll fix it myself. Previous Comments: [2006-04-26 07:31:04] [EMAIL PROTECTED] It means you didn't enable memory limit. php -r 'function foo() { $a = text; foo(); }; foo();' Fatal error: Allowed memory size of 2097152 bytes exhausted at ..Zend/zend_ptr_stack.h:59 (tried to allocate 137216 bytes) in Command line code on line 1 [2006-04-26 07:26:57] mailslot at mac dot com No. They really aren't. I don't have 2GB RAM set in the config file. [2006-04-26 07:25:18] [EMAIL PROTECTED] These values are completely ignored during recursion bombs. They ARE respected. [2006-04-26 04:58:26] mailslot at mac dot com Okay... no recursion limits. Fine. I'd rather have to enable dangerous recursion levels, but I can live without it. I still think this bug is valid. Could you please respect the configuration defines that set limits for script execution time and memory usage? These values are completely ignored during recursion bombs. Surely that's not expected behavior. If they worked as advertised, this bug would never have even manifested itself. [2006-04-26 03:13:56] judas dot iscariote at gmail dot com the recursion Limit problem is well known (for years), and there is no solution at this time.( because solution should be adecuate for any legitimate use, not just for average use) Use Xdebug to set a recursion limit in your dev enviroment. 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/37204 -- Edit this bug report at http://bugs.php.net/?id=37204edit=1
#37204 [NEW]: Can cause open-ended exception bomb
From: mailslot at mac dot com Operating system: Linux 2.4.21-9.EL PHP version: 5.1.2 PHP Bug Type: Reproducible crash Bug description: Can cause open-ended exception bomb Description: I encountered this problem while debugging an exception logging class. Infinite recursion problems are a coding mistake, but I've never seen one take down Apache before. Apache will grow in size until virtual memory starts swapping. The CPU will be at 100% and eventually, appears to halt. Limits, obviously, are not being used... yet. Reproduce code: --- ?php class Eggception extends Exception { public function __construct($ex) { parent::__construct($ex); try { // let's say that a database object throws derived Eggception throw new EggceptionSubclass('It happens'); // this is valid (not infinitely recursive) //throw new Exception('It happens'); } catch (Exception $e) { // should swallow exception, right? // not before a never-ending recursive bomb } } } class EggceptionSubclass extends Eggception {} // the following causes a runaway process (memory leak // CPU spike) with Apache 2.0.55 and PHP 5.1.2 // rather quickly, all server resources become exhausted // without proper process limits, potentially crashing the // entire machine. throw new Eggception('Exception Bomb'); ? Expected result: A timeout after a large CPU spike... perhaps a stack overflow error. An exception recursion counter that kills a script whenever it's 1,000 layers deep in an exception stack... that would be great. Actual result: -- The process (PHP or Apache, depending on which are used to execute the script) will consume as much memory allowed while pegging the CPU at 100% utilization. Kill -9 works fine. Workarounds include ulimit and softlimit. -- Edit bug report at http://bugs.php.net/?id=37204edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37204r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37204r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37204r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37204r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37204r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37204r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=37204r=needscript Try newer version:http://bugs.php.net/fix.php?id=37204r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37204r=support Expected behavior:http://bugs.php.net/fix.php?id=37204r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37204r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37204r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37204r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37204r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37204r=dst IIS Stability:http://bugs.php.net/fix.php?id=37204r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37204r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37204r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37204r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=37204r=mysqlcfg
#37204 [Opn]: Can cause open-ended exception bomb
ID: 37204 User updated by: mailslot at mac dot com Reported By: mailslot at mac dot com Status: Open Bug Type: Reproducible crash Operating System: Linux 2.4.21-9.EL PHP Version: 5.1.2 New Comment: Okay... no recursion limits. Fine. I'd rather have to enable dangerous recursion levels, but I can live without it. I still think this bug is valid. Could you please respect the configuration defines that set limits for script execution time and memory usage? These values are completely ignored during recursion bombs. Surely that's not expected behavior. If they worked as advertised, this bug would never have even manifested itself. Previous Comments: [2006-04-26 03:13:56] judas dot iscariote at gmail dot com the recursion Limit problem is well known (for years), and there is no solution at this time.( because solution should be adecuate for any legitimate use, not just for average use) Use Xdebug to set a recursion limit in your dev enviroment. [2006-04-26 00:45:04] mailslot at mac dot com Description: I encountered this problem while debugging an exception logging class. Infinite recursion problems are a coding mistake, but I've never seen one take down Apache before. Apache will grow in size until virtual memory starts swapping. The CPU will be at 100% and eventually, appears to halt. Limits, obviously, are not being used... yet. Reproduce code: --- ?php class Eggception extends Exception { public function __construct($ex) { parent::__construct($ex); try { // let's say that a database object throws derived Eggception throw new EggceptionSubclass('It happens'); // this is valid (not infinitely recursive) //throw new Exception('It happens'); } catch (Exception $e) { // should swallow exception, right? // not before a never-ending recursive bomb } } } class EggceptionSubclass extends Eggception {} // the following causes a runaway process (memory leak // CPU spike) with Apache 2.0.55 and PHP 5.1.2 // rather quickly, all server resources become exhausted // without proper process limits, potentially crashing the // entire machine. throw new Eggception('Exception Bomb'); ? Expected result: A timeout after a large CPU spike... perhaps a stack overflow error. An exception recursion counter that kills a script whenever it's 1,000 layers deep in an exception stack... that would be great. Actual result: -- The process (PHP or Apache, depending on which are used to execute the script) will consume as much memory allowed while pegging the CPU at 100% utilization. Kill -9 works fine. Workarounds include ulimit and softlimit. -- Edit this bug report at http://bugs.php.net/?id=37204edit=1