#38387 [Fbk->Bgs]: Calling set_error_handler from constructor segfaults apache
| From: | tony2001@php.net | Date: | Wed, 09 Aug 2006 08:32:49 +0000 |
| Subject: | #38387 [Fbk->Bgs]: Calling set_error_handler from constructor segfaults apache | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100573@lists.php.net to get a copy of this message | ||
ID: 38387
Updated by: tony2001@php.net
Reported By: trivoallan at clever-age dot com
-Status: Feedback
+Status: Bogus
Bug Type: Apache2 related
Operating System: GNU/Linux (ubuntu dapper)
PHP Version: 5.1.4
New Comment:
1) Please try latest snapshot.
http://snaps.php.net/php5.2-latest.tar.gz
2) After that, if you are still able to reproduce it, please provide a
SHORT (max. 20 lines long) and COMPLETE (without any includes of
non-existent files etc.) reproduce script.
Until then -> bogus.
Previous Comments:
------------------------------------------------------------------------
[2006-08-09 07:52:44] mike@php.net
Sorry, I didn't even look further require_once.
------------------------------------------------------------------------
[2006-08-08 22:22:13] trivoallan at clever-age dot com
bugs.php.net says : "Please do not SPAM our bug system."
so here's a link to the code : http://hashphp.org/pastebin.php?pid=8014
------------------------------------------------------------------------
[2006-08-08 22:01:43] judas dot iscariote at gmail dot com
again, need **complete** reproduce code ..
WTH the setFailureMessage() and errorOccured() methods do eh ?
------------------------------------------------------------------------
[2006-08-08 21:52:34] trivoallan at clever-age dot com
I found the source of the problem while reviewing the handleError
method code (thanks for the pointer :).
There was a missing break in the switch statement.
Should it segfault anyway ?
Here's the uncorrected code for the handleError method :
function handleRuntimeError($errno, $errstr, $errfile = null,
$errline = null, $errcontext = array() )
{
$error_types = array (
E_ERROR => 'Error',
E_WARNING => 'Warning',
E_PARSE => 'Parsing Error',
E_NOTICE => 'Notice',
E_CORE_ERROR => 'Core Error',
E_CORE_WARNING => 'Core Warning',
E_COMPILE_ERROR => 'Compile Error',
E_COMPILE_WARNING => 'Compile Warning',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Runtime Notice',
E_RECOVERABLE_ERRROR => 'Catchable Fatal Error'
);
$msg = sprintf('%s : "%s" occured in %s on line %d',
$error_types[$errno], $errstr, $errfile, $errline);
switch($errno)
{
// A notice cannot fail the job
case E_NOTICE:
$this->setFailureMessage($msg);
default:
$this->errorOccured($msg, $this->getMaxTries());
}
}
------------------------------------------------------------------------
[2006-08-08 21:04:10] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Can't reproduce.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/38387
--
Edit this bug report at http://bugs.php.net/?id=38387&edit=1