#35017 [Opn]: PHP crashes Apache
ID: 35017
User updated by: assen dot todorov at onvista dot de
Reported By: assen dot todorov at onvista dot de
Status: Open
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.0.5
New Comment:
On the seccond "foreach" the error handler is called and an exception
is thrown.In spite of this the line "$crashApache->start($result);" is
executed and the exception is newer catched
Previous Comments:
------------------------------------------------------------------------
[2005-10-29 10:56:10] assen dot todorov at onvista dot de
Description:
------------
The code below was tested on WindowsXP + PHP(5.0.5) + Apache(1.3.33)
AND Linux + PHP(5.0.5) + Apache(Apache/2.0.53).In both cases this code
leads to crash in Apache.The message is "Segmentation fault ......."
Reproduce code:
---------------
set_error_handler('errorHandler');
$crashApache = new crashApache;
try {
$a = array('test'); $result = array();
foreach($a as $b) {
$result[] = $b; $nullValue = null;
foreach($nullValue as $c) {
$result[] = $c;
}
}
$crashApache->start($result);
}
catch(Exception $e) { echo 'This Exception should be catched'; }
class crashApache {
public $someVar = array();
public function start(&$crashParam) {
$this->someVar = $crashParam;
}
}
function errorHandler($errno, $errstr, $errfile, $errline, $vars) {
throw new Exception('Some Exception');
}
Expected result:
----------------
I expect to see the the message "This Exception should be catched"
Actual result:
--------------
Apache crashes with "segmentation fault" message.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35017&edit=1
Thread (4 messages)