#19603 [NEW]: Domxml causes segfault

From: Date: Wed, 25 Sep 2002 20:40:08 +0000
Subject: #19603 [NEW]: Domxml causes segfault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-20364@lists.php.net to get a copy of this message
From:             cb@designassembly.de
Operating system: Windows XP
PHP version:      4.2.3
PHP Bug Type:     DOM XML related
Bug description:  Domxml causes segfault

System: Apache/1.3.24 PHP running as SAPI-module (Binary from php.net)

simple script, which causes segfault 
<?
/*part 1 scan xml document*/
	$xml="<?xml version=\"1.0\"?><para><element>content
1</element><element>content 2</element><element>content
3</element><element>content 4</element></para>";

$document = xmltree($xml);
$ctx = xpath_new_context($document); 
$result = xpath_eval($ctx, "//element");
print_r($result);

/*part 2 create new xml document*/
	$doc = domxml_new_doc("1.0");
	$root = $doc->append_child($doc->create_element("para"));
	for($i = 0; $i < 200; $i++){
		$element = $doc->create_element("element");
		$element->set_content("content ".$i);
		$root->append_child($element);
	}
	echo "<PRE>".htmlentities($doc->dump_mem(true))."</PRE>";
?>

Description:
the content is shown in the browser, but apache causes a
segfault in module  php_domxml.dll, adress 0x00001b03
as likely in bug 16888.
When you first create a xml document and parse second it runs without a
segfault.

This code causes no problems with PHP 4.1.2.

Modules:
php_domxml, php_xslt, php_iconv, php_gd and mysql



-- 
Edit bug report at http://bugs.php.net/?id=19603&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19603&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19603&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19603&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19603&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19603&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19603&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19603&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19603&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19603&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19603&r=globals



Thread (5 messages)

« previous php.bugs (#20364) next »