php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33218 Apache crash on declaring a private methode __destruct with debug_backtrace
Submitted: 2005-06-02 11:34 UTC Modified: 2005-06-02 12:11 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: robo47 at robo47 dot net Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.0.4 OS: Linux and Windows
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: robo47 at robo47 dot net
New email:
PHP Version: OS:

 

 [2005-06-02 11:34 UTC] robo47 at robo47 dot net
Description:
------------
The following Code was testet on a Suse 9.0 Server (PHP 5.0.4) and on a local Windows-machine(PHP 5.0.2) and it crashs the Apache Webserver:

The Error Occurs when i want to use my error-handler (the posted version is a minimized version with only relevant parts) and i set the __destruct-function as an private, not as a public methode. 
Using the standard-errorhandler the following Error is shown:

Warning: Call to private testclass::__destruct() from context '' during shutdown ignored in Unknown on line 0


Reproduce code:
---------------
<?php
error_reporting (E_ALL);
class ErrorHandlerClass {
   public function __construct() {
      set_error_handler(array(&$this,'ErrorHandler'));
   }
   public function ErrorHandler($errno, $errstr, $errfile, $errline) {
      echo debug_backtrace();  // the problem which crashs the script
   }
}
$error = new ErrorHandlerClass();
class testclass {
   public function __construct() {
      echo 'test1';
   }
   private function __destruct() {// here is the Error, because the __destruct should be public !!
   
      echo 'test2';
   }
}
$test = new testclass();
?> 

Expected result:
----------------
The Output of debug_backtrace(); should appear 

Actual result:
--------------
On Windows-machine the Apache crashs and restarts with this Entry in the apache-errorlog:

[Thu Jun 02 11:23:11 2005] [notice] Parent: child process exited with status 1073807364 -- Restarting.

the linux-machine shows the following in the apache-errorlog:

[Wed Jun 01 17:49:21 2005] [notice] child pid 26331 exit signal Segmentation fault (11)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-02 11:45 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

I can't reproduce this, so it might be fixed already.

 [2005-06-02 12:11 UTC] robo47 at robo47 dot net
Okay thx, tested the Windows CVS-Build and it worked without an Error.

greetz
robo47
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 05:01:31 2024 UTC