|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
9 + 12 = ?
Subscribe to this entry?

 [2008-01-15 12:20 UTC] dzonny dot dz at gmail dot com
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;
echo "Done $st, ";
self::$st.="Some string like this;\r\n";

Expected result:
No crash.

Actual result:
The was an error in Apache HTP Server Application ... message.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-28 23:41 UTC]
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-2023 The PHP Group
All rights reserved.
Last updated: Sun Sep 24 09:01:24 2023 UTC