|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-03-08 12:00 UTC] bugs at niluje dot net
Description:
------------
var_dump() on an exception crashes php5.
#0 0xb57f0c0e in zend_objects_clone_obj () from /usr/lib/apache/1.3/libphp5.so
(gdb) bt
#0 0xb57f0c0e in zend_objects_clone_obj () from /usr/lib/apache/1.3/libphp5.so
#1 0xb577f00d in php_var_dump () from /usr/lib/apache/1.3/libphp5.so
#2 0xb577ee3f in url_adapt () from /usr/lib/apache/1.3/libphp5.so
#3 0xb57e5986 in zend_hash_apply_with_arguments () from /usr/lib/apache/1.3/libphp5.so
#4 0xb577f0b7 in php_var_dump () from /usr/lib/apache/1.3/libphp5.so
#5 0xb577f1d6 in zif_var_dump () from /usr/lib/apache/1.3/libphp5.so
#6 0xb581b851 in zend_do_fcall_common_helper () from /usr/lib/apache/1.3/libphp5.so
#7 0xb581bfd0 in zend_do_fcall_handler () from /usr/lib/apache/1.3/libphp5.so
#8 0xb580024f in execute () from /usr/lib/apache/1.3/libphp5.so
#9 0xb57df043 in zend_execute_scripts () from /usr/lib/apache/1.3/libphp5.so
#10 0xb57a8c55 in php_execute_script () from /usr/lib/apache/1.3/libphp5.so
#11 0xb5824755 in apache_php_module_main () from /usr/lib/apache/1.3/libphp5.so
#12 0xb582537e in apache_php_module_main () from /usr/lib/apache/1.3/libphp5.so
#13 0xb58253e5 in apache_php_module_main () from /usr/lib/apache/1.3/libphp5.so
#14 0x080553c3 in ap_invoke_handler ()
#15 0x08068465 in ap_some_auth_required ()
#16 0x08068614 in ap_process_request ()
#17 0x08060bd2 in ap_child_terminate ()
#18 0x08060de7 in ap_child_terminate ()
#19 0x080610c7 in ap_child_terminate ()
#20 0x08061a48 in ap_child_terminate ()
#21 0x08061ff8 in main ()
Reproduce code:
---------------
catch (Exception $e) {
var_dump ($e);
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 06:00:01 2025 UTC |
here is a test case to trigger the segfault : you need PEAR, DB, DB_Dataobject: test.php ---------------------- <?php require_once 'PEAR.php'; require_once 'DB/DataObject.php'; PEAR::setErrorHandling(PEAR_ERROR_EXCEPTION); $config = parse_ini_file('dao.ini', TRUE); foreach($config as $class=>$values) { $options = &PEAR::getStaticProperty($class, 'options'); $options = $values; } $options = &PEAR::getStaticProperty('DB_DataObject','options'); $options['class_prefix'] = ''; $options['persistent'] = true; class Test extends DB_Dataobject { public $__table = 'test'; } $dao = new Test(); try { $dao->field1 = 'test'; $dao->insert(); } catch (Exception $e) { var_dump($e); } ?> ----------- dao.ini --------- [DB_DataObject] debug = 1 database_test = mysqli://root@localhost/test table_test = test --------- gdb backtrace: ----------- #0 0xb57f0c0e in zend_objects_clone_obj () from /usr/lib/apache/1.3/libphp5.so #0 0xb57f0c0e in zend_objects_clone_obj () from /usr/lib/apache/1.3/libphp5.so #1 0xb577f00d in php_var_dump () from /usr/lib/apache/1.3/libphp5.so #2 0xb577ee3f in url_adapt () from /usr/lib/apache/1.3/libphp5.so #3 0xb57e5986 in zend_hash_apply_with_arguments () from /usr/lib/apache/1.3/libphp5.so #4 0xb577f0b7 in php_var_dump () from /usr/lib/apache/1.3/libphp5.so #5 0xb577f1d6 in zif_var_dump () from /usr/lib/apache/1.3/libphp5.so #6 0xb581b851 in zend_do_fcall_common_helper () from /usr/lib/apache/1.3/libphp5.so #7 0xb581bfd0 in zend_do_fcall_handler () from /usr/lib/apache/1.3/libphp5.so #8 0xb580024f in execute () from /usr/lib/apache/1.3/libphp5.so #9 0xb57df043 in zend_execute_scripts () from /usr/lib/apache/1.3/libphp5.so #10 0xb57a8c55 in php_execute_script () from /usr/lib/apache/1.3/libphp5.so #11 0xb5824755 in apache_php_module_main () from /usr/lib/apache/1.3/libphp5.so #12 0xb582537e in apache_php_module_main () from /usr/lib/apache/1.3/libphp5.so #13 0xb58253e5 in apache_php_module_main () from /usr/lib/apache/1.3/libphp5.so #14 0x080553c3 in ap_invoke_handler () #15 0x08068465 in ap_some_auth_required () #16 0x08068614 in ap_process_request () #17 0x08060bd2 in ap_child_terminate () #18 0x08060de7 in ap_child_terminate () #19 0x08060f10 in ap_child_terminate () #20 0x08061a9a in ap_child_terminate () #21 0x08061ff8 in main () ------------------------i do not have the time or the expertise to compile php with debug options. the segfault happends in PEAR.php (PEAR 1.3.5) line 863 eval('$e = new Exception($this->message, $this->code);$e->PEAR_Error = $this;throw($e);'); it appears that $e->PEAR_Error = $this causes the segfault.