Bug #69593 [NEW]: Apache exit signal Segmentation fault (11)
| From: | kvsk at i dot ua | Date: | Thu, 07 May 2015 09:39:54 +0000 |
| Subject: | Bug #69593 [NEW]: Apache exit signal Segmentation fault (11) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-192550@lists.php.net to get a copy of this message | ||
From: kvsk at i dot ua
Operating system: *nix
PHP version: 5.6.8
Package: DOM XML related
Bug Type: Bug
Bug description:Apache exit signal Segmentation fault (11)
Description:
------------
Apache exit (signal Segmentation fault (11)) if do
"$node->parentNode->removeChild($node);" when $node became '#text'
On windows version there is no that error
Test script:
---------------
$html = '<!DOCTYPE html><html><head><meta
http-equiv="Content-Type"
content="text/html; charset=utf-8"></head><body><div
id="div1"><div
id="div2">222</div><div
id="div3">333</div></div></body></html>';
$doc = new DOMDocument;
libxml_use_internal_errors(true);
$doc->loadHTML($html);
$div1=$doc->getElementById('div1');
$div2=$doc->getElementById('div2');
$div3=$doc->getElementById('div3');
print_r($div2);
print_r($div3);
$div1->nodeValue='';
$div1->appendChild($doc->createTextNode(html_entity_decode('111')));
print_r(array($div2,$div2->parentNode));
print_r(array($div3,$div3->parentNode));
$div3->parentNode->removeChild($div3);
echo $doc->saveHTML();
Expected result:
----------------
After $div1->nodeValue='';
must $div2 and $div3 === null or thiers parentNode
On call $div3->parentNode->removeChild($div3); must be Fatal error
Actual result:
--------------
On windows version after $div1->nodeValue='';
$div2->nodeType is 3 (#text)
$div3->nodeType is 1 (div)
nodeValue for both is '111';
$div3->parentNode->removeChild($div3); removes textNode
On *nix version Apache exit signal Segmentation fault (11) when
$div3->parentNode->removeChild($div3);
--
Edit bug report at https://bugs.php.net/bug.php?id=69593&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69593&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69593&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69593&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69593&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69593&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69593&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69593&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69593&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69593&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69593&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69593&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69593&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69593&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69593&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69593&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69593&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69593&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69593&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69593&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69593&r=mysqlcfg