php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26275 Server Crash when throw exception
Submitted: 2003-11-16 12:20 UTC Modified: 2004-01-11 08:40 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: php dot bug at stre dot it Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2003-11-19 (dev) OS: *
Private report: No CVE-ID: None
 [2003-11-16 12:20 UTC] php dot bug at stre dot it
Description:
------------
this code below bring my server to crash

Reproduce code:
---------------
<?PHP
class Bad {
	public static function badfunc() {
		throw new Exception('Some Exception from bad class');
		return 'hello';
	}
	public static function badcall($obj1, $key1, $val1) {
		return 'hello';
	}
}

try {
	function test() {
		Bad::badcall('test','bad',Bad::badfunc());
		echo 'server ok';
	}
	test();
}
catch(Exception $err)	{
		echo $err->getMessage();
}

?>

Expected result:
----------------
no response from server, must restart service


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-16 13:20 UTC] php dot bug at stre dot it
sorry short version work, because there is first a standalone badfunc call, this version dont work

<?PHP
function badfunc() {
	throw new Exception('Some Exception from bad clas');
}
function badcall($aaa, $bbb, $ccc) {}

function test() {
	badcall(1,1,badfunc());
	echo 'server ok';
}
test();
?>

i think is a failure by building stack trace
 [2003-11-18 19:15 UTC] sniper@php.net
#0  0x08318170 in _zval_ptr_dtor (zval_ptr=0x40e33bf8, 
    __zend_filename=0x856f580 "/usr/src/web/php/php5/Zend/zend_execute.h", __zend_lineno=122)
    at /usr/src/web/php/php5/Zend/zend_execute_API.c:352
#1  0x0834e4cb in zend_ptr_stack_clear_multiple () at zend_execute.h:122
#2  0x08349a4e in zend_do_fcall_common_helper (execute_data=0xbfffd7b0, op_array=0x40e428b4)
    at /usr/src/web/php/php5/Zend/zend_execute.c:2644
#3  0x08349c57 in zend_do_fcall_handler (execute_data=0xbfffd7b0, op_array=0x40e428b4)
    at /usr/src/web/php/php5/Zend/zend_execute.c:2696
#4  0x0834571f in execute (op_array=0x40e428b4) at /usr/src/web/php/php5/Zend/zend_execute.c:1271
#5  0x08324148 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/web/php/php5/Zend/zend.c:1016
#6  0x082e303a in php_execute_script (primary_file=0xbffffbb0) at /usr/src/web/php/php5/main/main.c:1622
#7  0x0835d87b in main (argc=2, argv=0xbffffc44) at /usr/src/web/php/php5/sapi/cli/php_cli.c:910

 [2003-12-27 18:04 UTC] helly@php.net
See #26698
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 18:01:35 2024 UTC