From:             cw at centerwave dot de
Operating system: Linux 2.4.18
PHP version:      5CVS-2003-07-19 (dev)
PHP Bug Type:     DOM XML related
Bug description:  PHP segfaults on creating domelement from domdocument-object with 2 
arguments

Description:
------------
PHP segfaults while creating a DOM-element from a DOM-document-object with
$document->createelement("Arg1","Arg2). If the 2nd argument is not set it
works.

When creating domelement not from the domdocument-object with $element =
new domelement("Arg1","Arg2") it works.

Reproduce code:
---------------
$document = new domdocument;

// This works
//$greeting = new domelement("greeting","hello world");

// This segfaults
$greeting = $document->createelement("greeting","hello world");



Expected result:
----------------
<greeting>hello world</greeting>

Actual result:
--------------
#0  0x0813a10c in _emalloc (size=28, __zend_filename=0x8176180
"/home/blacknight/php5-200307190930/ext/dom/php_dom.c", __zend_lineno=845,
__zend_orig_filename=0x0, __zend_orig_lineno=0) at
/home/blacknight/php5-200307190930/Zend/zend_alloc.c:143
#1  0x0807cd74 in dom_objects_new (class_type=0x8203bd8,
tsrm_ls=0x81b8e90) at
/home/blacknight/php5-200307190930/ext/dom/php_dom.c:845
#2  0x0815024d in _object_and_properties_init (arg=0x4045ef50,
class_type=0x8203bd8, properties=0x0, __zend_filename=0x8176180
"/home/blacknight/php5-200307190930/ext/dom/php_dom.c", __zend_lineno=969,
tsrm_ls=0x81b8e90) at
/home/blacknight/php5-200307190930/Zend/zend_API.c:681
#3  0x081502c1 in _object_init_ex (arg=0x4045ef50, class_type=0x8203bd8,
__zend_filename=0x8176180
"/home/blacknight/php5-200307190930/ext/dom/php_dom.c", __zend_lineno=969,
tsrm_ls=0x81b8e90) at
/home/blacknight/php5-200307190930/Zend/zend_API.c:688
#4  0x0807cf1b in php_dom_create_object (obj=0x824b400, found=0xbfffd4d0,
wrapper_in=0x0, return_value=0x4045ef50, domobj=0x4045fb10,
tsrm_ls=0x81b8e90) at
/home/blacknight/php5-200307190930/ext/dom/php_dom.c:969
#5  0x0807e275 in zif_dom_document_create_element (ht=2,
return_value=0x4045ef50, this_ptr=0x4, return_value_used=1,
tsrm_ls=0x81b8e90) at
/home/blacknight/php5-200307190930/ext/dom/document.c:468
#6  0x0816bed4 in zend_do_fcall_common_helper (execute_data=Cannot access
memory at address 0x13
) at /home/blacknight/php5-200307190930/Zend/zend_execute.c:2632
This frame inner-to next frame (corrupt stack?)


-- 
Edit bug report at http://bugs.php.net/?id=24715&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24715&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24715&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=24715&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24715&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24715&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24715&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24715&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24715&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24715&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24715&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24715&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24715&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24715&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24715&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24715&r=gnused

Reply via email to