php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69593 Apache exit signal Segmentation fault (11)
Submitted: 2015-05-07 09:39 UTC Modified: 2020-02-29 12:37 UTC
Votes:3
Avg. Score:4.0 ± 1.4
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: kvsk at i dot ua Assigned: girgias (profile)
Status: Closed Package: DOM XML related
PHP Version: 5.6.8 OS: *nix
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 20 = ?
Subscribe to this entry?

 
 [2015-05-07 09:39 UTC] kvsk at i dot ua
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);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-28 19:01 UTC] cmb@php.net
Confirmed: <https://3v4l.org/IpKCv>.
 [2016-06-28 19:01 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2020-02-29 12:37 UTC] girgias@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: girgias
 [2020-02-29 12:37 UTC] girgias@php.net
Duplicate of Bug #69373
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC