#43855 [NEW]: Apache crashes when creating large number of instances in static function

From: Date: Tue, 15 Jan 2008 12:20:34 +0000
Subject: #43855 [NEW]: Apache crashes when creating large number of instances in static function
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121299@lists.php.net to get a copy of this message
From: dzonny dot dz at gmail dot com Operating system: Windows XP Pro SP2 CZ PHP version: 5.2.5 PHP Bug Type: Class/Object related Bug description: Apache crashes when creating large number of instances in static function Description: ------------ Code below always makes my Apache (2.2) to crash. It's class with static function. Thet static function creates instance of the class and call some method on it. It also appends string to static variable and produces output. It is called in a loop 1000 times. When called 999 times - no crash. The crash occurs AFTER the code is evaluated (it means when called 2500, there are 2500 outputs and the crash report). Reproduced also on Windows Vista Business EN, Apache 2.2. NOT reproduced on any Linux I have access to. Reproduce code: --------------- class X{ public function __construct(){} public static function DoSthStatic(){$inst=new X();$inst->DoSth();return $inst;} static $st; public function DoSth(){ static $st; @$st++; echo "Done $st, "; self::$st.="Some string like this;\r\n"; } } for($i=0;$i<1000;$i++) X::DoSthStatic(); Expected result: ---------------- No crash. Actual result: -------------- Crash. The was an error in Apache HTP Server Application ... message. -- Edit bug report at http://bugs.php.net/?id=43855&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43855&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43855&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43855&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43855&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43855&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43855&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43855&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43855&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43855&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43855&r=support Expected behavior: http://bugs.php.net/fix.php?id=43855&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43855&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43855&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43855&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43855&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43855&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43855&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43855&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43855&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43855&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43855&r=mysqlcfg

« previous php.bugs (#121299) next »