php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19603 Domxml causes segfault
Submitted: 2002-09-25 15:40 UTC Modified: 2002-10-13 13:05 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: cb at designassembly dot de Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.2.3 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cb at designassembly dot de
New email:
PHP Version: OS:

 

 [2002-09-25 15:40 UTC] cb at designassembly dot de
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



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-26 08:12 UTC] sander@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-09-27 12:31 UTC] cb at designassembly dot de
didnt't crash with 200 elements and latest CVS snapshot, but with 400 or more elements it still causes a segfault under apache and windows xp. Each part alone still runs fine.
systemconfig:
 see my initial bug report
 [2002-10-05 01:53 UTC] iliaa@php.net
Works fine on Linux with any number of itterations, however it still crashes on windows with 400+ itterations.
 [2002-10-13 13:05 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 16:01:31 2024 UTC