php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43855 Apache crashes when creating large number of instances in static function
Submitted: 2008-01-15 12:20 UTC Modified: 2008-02-05 01:00 UTC
From: dzonny dot dz at gmail dot com Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 5.2.5 OS: Windows XP Pro SP2 CZ
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-01-15 12:20 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-28 23:41 UTC] tony2001@php.net
Cannot reproduce any problems.
 [2008-02-05 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: Sat Apr 20 05:01:27 2024 UTC