From: [EMAIL PROTECTED]
Operating system: FreeBSD6
PHP version: 5CVS-2006-03-25 (CVS)
PHP Bug Type: Reproducible crash
Bug description: DOMElement crashes when calling __construct when clone'ing
Description:
------------
Seems to crash when calling DOMElement::__construct() when calling
__clone() on a object that extends DOMElement.
Reproduce code:
---------------
<?php
class foo extends DOMElement {
public function __clone() {
parent::__construct("foo");
}
}
$foo = new foo("foo");
$foobar = clone $foo;
Actual result:
--------------
#0 0x08069fe9 in php_libxml_node_free_list (node=0x2a8fcc84) at
/usr/src/php51/ext/libxml/libxml.c:206
#1 0x0806b7a4 in php_libxml_node_free_resource (node=0x83688e4) at
/usr/src/php51/ext/libxml/libxml.c:967
#2 0x0809e162 in zif_domelement___construct (ht=1,
return_value=0x835d064, return_value_ptr=0x0, this_ptr=0x8368fe4,
return_value_used=0)
at /usr/src/php51/ext/dom/element.c:133
#3 0x0819ef42 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfbfce40) at zend_vm_execute.h:200
#4 0x0819f9c5 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0xbfbfce40) at zend_vm_execute.h:322
#5 0x0819eb62 in execute (op_array=0x836a424) at zend_vm_execute.h:92
#6 0x08175d93 in zend_call_function (fci=0xbfbfd030,
fci_cache=0xbfbfcff0) at /usr/src/php51/Zend/zend_execute_API.c:938
#7 0x08194436 in zend_call_method (object_pp=0xbfbfd0b4,
obj_ce=0x835fc24, fn_proxy=0x835fd2c, function_name=0x821f20e "__clone",
function_name_len=7,
retval_ptr_ptr=0x0, param_count=0, arg1=0x0, arg2=0x0) at
/usr/src/php51/Zend/zend_interfaces.c:88
#8 0x08199a1a in zend_objects_clone_members (new_object=0x83747a4,
new_obj_val={handle = 2, handlers = 0x8275a60}, old_object=0x8372124,
handle=2)
at /usr/src/php51/Zend/zend_objects.c:152
#9 0x0809456b in dom_objects_store_clone_obj (zobject=0x8368964) at
/usr/src/php51/ext/dom/php_dom.c:449
#10 0x081d27f2 in ZEND_CLONE_SPEC_CV_HANDLER (execute_data=0xbfbfd230) at
zend_vm_execute.h:19348
#11 0x0819eb62 in execute (op_array=0x836a324) at zend_vm_execute.h:92
#12 0x08181758 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /usr/src/php51/Zend/zend.c:1109
#13 0x0813e06f in php_execute_script (primary_file=0xbfbfe9e0) at
/usr/src/php51/main/main.c:1726
#14 0x081e54df in main (argc=2, argv=0xbfbfea74) at
/usr/src/php51/sapi/cli/php_cli.c:1092
--
Edit bug report at http://bugs.php.net/?id=36859&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36859&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36859&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36859&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36859&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36859&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36859&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36859&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36859&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36859&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36859&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36859&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36859&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36859&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36859&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36859&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36859&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36859&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36859&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36859&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36859&r=mysqlcfg