#39662 [Asn->Csd]: Segfault when calling asXML() of a cloned SimpleXMLElement
| From: | tony2001@php.net | Date: | Tue, 28 Nov 2006 18:59:59 +0000 |
| Subject: | #39662 [Asn->Csd]: Segfault when calling asXML() of a cloned SimpleXMLElement | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105573@lists.php.net to get a copy of this message | ||
ID: 39662
Updated by: tony2001@php.net
Reported By: alexiev at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: SimpleXML related
Operating System: Debian Unstable 2.6.16-2-686
PHP Version: 5.2.0
Assigned To: tony2001
New Comment:
This bug has been fixed in CVS.
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/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-11-28 16:16:15] alexiev at gmail dot com
Description:
------------
When calling asXML() to a cloned element, the php segfaults. I've got
no debug information, but the bug is easy to reproduce. I had this
problem with PHP 5.2.0 and PHP 5.1.6. With PHP 5.1.2 everything is OK.
The xml file is just an example - this happens with every xml file I
tried!
Reproduce code:
---------------
alexiev-home:~/tests# cat SimpleXML.xml
<?xml version="1.0" encoding="utf-8" ?>
<test>
</test>
alexiev-home:~/tests# cat SimpleXML.php
<?php
$root = simplexml_load_file('SimpleXML.xml');
$clone = clone $root;
var_dump($root);
var_dump($clone);
echo $clone->asXML(); // Segfault here
?>
Expected result:
----------------
object(SimpleXMLElement)#1 (1) {
[0]=>
string(2) "
"
}
object(SimpleXMLElement)#2 (1) {
[0]=>
string(2) "
"
}
string(55) "<?xml version="1.0" encoding="utf-8"?>
<test>
</test>
"
Actual result:
--------------
object(SimpleXMLElement)#1 (1) {
[0]=>
string(2) "
"
}
object(SimpleXMLElement)#2 (1) {
[0]=>
string(2) "
"
}
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39662&edit=1