From:             robo47 at robo47 dot net
Operating system: Linux and Windows
PHP version:      5.0.4
PHP Bug Type:     Reproducible crash
Bug description:  Apache crash on declaring a private methode __destruct with 
debug_backtrace

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)

-- 
Edit bug report at http://bugs.php.net/?id=33218&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33218&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33218&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33218&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33218&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33218&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33218&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33218&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33218&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33218&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33218&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33218&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33218&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33218&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33218&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33218&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33218&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33218&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33218&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33218&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33218&r=mysqlcfg

Reply via email to