|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41608 user error handler crashes
Submitted: 2007-06-06 07:44 UTC Modified: 2009-09-27 14:27 UTC
Avg. Score:4.5 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:4 (66.7%)
Same OS:4 (66.7%)
From: aigors at inbox dot lv Assigned: dmitry (profile)
Status: Wont fix Package: Reproducible crash
PHP Version: 5.2.10 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: aigors at inbox dot lv
New email:
PHP Version: OS:


 [2007-06-06 07:44 UTC] aigors at inbox dot lv
Apache crash because of script containing set_error_handler function.

Reproduce code:
/***Main php file***/
function MyErrorHandler($errno, $errstr, $errfile, $errline){
echo('I am done');

/***blah.php file***/
class Blah {
  function foo($value, $classname) {
    switch(strtolower($value['key'])) {
      default: $x = &new $classname;

/***empty.php file - no content***/

Expected result:
Should output "I am done"

Actual result:
Apache crash


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-06 08:35 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2007-12-18 09:47 UTC] aigors at inbox dot lv
Bug still exists in PHP 5.2.5.
 [2008-01-15 07:29 UTC] aigors at inbox dot lv
Yes, it appears that bug is in the snapshots also.
 [2008-01-26 01:07 UTC] claimed to have fixed this? :)
 [2008-02-09 01:14 UTC]
Breaks for me in 5.3CVS head too.
 [2008-08-13 20:09 UTC]
Does not crash (in Linux, non ZTS) with latest snapshots of PHP_5_2 and PHP_5_3 branches.
 [2009-06-15 09:18 UTC] aigors at inbox dot lv
Fails for me with PHP Version 5.2.10RC2 with the same test case.
 [2009-06-15 09:26 UTC] aigors at inbox dot lv
Also fails with the latest snapshot 5.2.10RC3-dev with build date Jun 14 2009 23:39:25.
 [2009-06-29 10:57 UTC]
Not reproducible with latest 5.2, but I do see some problems in 5.3 under Valgrind.
Dmitry, please check this out.
 [2009-06-29 11:22 UTC] aigors at inbox dot lv
I made a crash report when running script with stable 5.2.10 PHP version with the php.ini-dist. It can be found in
 [2009-06-29 13:54 UTC]
The crash occurs because the compiler is not reinterant and this test case makes recursive compiler call. Of course it's not a good idea to call include from error handler.

I think it's not possible to make compiler reinterant in 5.2 (because if binary compatibility), we can just disable recursive calls and emit coresponding error message. It's not a perfect decision as well, as it may break some code which worked before.

Even for 5.3 it's not a simple fix but a big feature that may delay GA release.
 [2009-07-23 11:47 UTC] svoboda at svoon dot net
Hi all,
does it mean that is already fixed in CVS version (5.2x and 5.3x) branches?

thank you
 [2009-09-25 22:34 UTC]
Please try using this snapshot:
For Windows:

I can not reproduce this with either latest 5.2 (basically 5.2.11) or 
5.3.1RC1 under Linux (non ZTS builds). 
 [2009-09-25 23:25 UTC] aigors at inbox dot lv
Still crashes with 5.2.11 on Windows XP OS.

After the dmitry comment I've understood that this issue is going to the "wontfix" status.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 15:01:36 2024 UTC