#43855 [Opn->Fbk]: Apache crashes when creating large number of instances in static function

From: Date: Mon, 28 Jan 2008 23:41:20 +0000
Subject: #43855 [Opn->Fbk]: Apache crashes when creating large number of instances in static function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121646@lists.php.net to get a copy of this message
ID: 43855 Updated by: tony2001@php.net Reported By: dzonny dot dz at gmail dot com -Status: Open +Status: Feedback Bug Type: Class/Object related Operating System: Windows XP Pro SP2 CZ PHP Version: 5.2.5 New Comment: Cannot reproduce any problems. Previous Comments: ------------------------------------------------------------------------ [2008-01-15 12:20:34] dzonny dot dz at gmail dot com 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 this bug report at http://bugs.php.net/?id=43855&edit=1

« previous php.bugs (#121646) next »