|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55130 Php engine crash on $node = clone (($condition) ? $oneNode : $theOtherNode);
Submitted: 2011-07-04 12:52 UTC Modified: 2013-02-18 00:34 UTC
From: ghostwik at gmail dot com Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.3.6 OS: Linux 2.6.39-ARCH x86_64
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.
Block user comment
Status: Assign to:
Bug Type:
From: ghostwik at gmail dot com
New email:
PHP Version: OS:


 [2011-07-04 12:52 UTC] ghostwik at gmail dot com
PHP caused Segmentation fault probably on code
$node = clone ($condition ? $DOMElement1 : $DOMElement2);

Test script:
// This piece of code actually loads some XML elements via xPath
$firstNode = $domElement->getElementsByTagName( 'div')->item(0);
$secondNode = $domElement->getElementsByTagName( 'div')->item(1);

// The problematic line
$node = clone ((rand()%2) ? $firstNode : $secondNode);

// // After retyping code to:
// $node = ((rand()%2) ? clone $firstNode : clone $secondNode);
// // All started working just fine (maybe it's coincidence) 

Expected result:
One node is domElement for "thumb up" and the other node is domElement for "thumb 
down" (for product rating in e-shop), I've tried to create new html based on xml 

Actual result:
Mos of the time I got error 302 from server and proxy error or "Empty result"

In log always repeated this: 
[Mon Jul 04 18:20:39 2011] [notice] child pid 5825 exit signal Segmentation 
fault (11)


[Mon Jul 04 18:20:39 2011] [notice] child pid 5825 exit signal Segmentation 
fault (11)
*** glibc detected *** /usr/sbin/httpd: double free or corruption (!prev): 
0x0000000001980e20 ***
======= Backtrace: =========

======= Memory map: ========
00400000-00460000 r-xp 00000000 fe:01 861362                             
0065f000-00664000 rw-p 0005f000 fe:01 861362                             
00664000-00667000 rw-p 00000000 00:00 0 
01571000-04298000 rw-p 00000000 00:00 0                                  [heap]
7f818c000000-7f818c021000 rw-p 00000000 00:00 0 
7f818c021000-7f8190000000 ---p 00000000 00:00 0 
7f81914b1000-7f81914c6000 r-xp 00000000 fe:01 631049                     
And few hundreds of similar lines.

On ArchLinux:
extra/php 5.3.6-4 [installed]



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-04 19:12 UTC]
-Status: Open +Status: Feedback
 [2011-07-04 19:12 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 01:01:31 2024 UTC