#35017 [Opn]: PHP crashes Apache

From: Date: Sat, 29 Oct 2005 09:07:42 +0000
Subject: #35017 [Opn]: PHP crashes Apache
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87200@lists.php.net to get a copy of this message
 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)

« previous php.bugs (#87200) next »