Bug #62653 [Com]: unset($array[$float]) causes a crash
| From: | nikic@php.net | Date: | Wed, 25 Jul 2012 16:48:21 +0000 |
| Subject: | Bug #62653 [Com]: unset($array[$float]) causes a crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-172234@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62653&edit=1
ID: 62653
Comment by: nikic@php.net
Reported by: davidso1 at rose-hulman dot edu
Summary: unset($array[$float]) causes a crash
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Windows Server
PHP Version: 5.4.5
Block user comment: N
Private report: N
New Comment:
I have a patch for this here: https://github.com/php/php-src/pull/144
If you could test whether it fixes the issue for you it would help a lot.
We had some issues reproducing the problem consistently, so would be nice to verify this :)
Previous Comments:
------------------------------------------------------------------------
[2012-07-25 15:55:10] jpauli@php.net
Switch to Scripting Engine Problem as bug type
------------------------------------------------------------------------
[2012-07-25 13:40:44] laruence@php.net
I can no reproduce this on Linux redhat
------------------------------------------------------------------------
[2012-07-24 19:27:22] sixd@php.net
The testcase produces invalid reads & writes in valgrind.
------------------------------------------------------------------------
[2012-07-24 16:16:05] davidso1 at rose-hulman dot edu
Description:
------------
The test code crashes apache in the 5.4+ environment.
$foo starts as a string, gets interpreted as a double but it isn't I guess.
unset($array[(double) $foo]) works as expected
Test script:
---------------
$array = array("5"=>"bar");
$foo = "10.0000"; // gettype($foo) = "string"
$foo /= 2; //Makes $foo = 5 but still gettype($foo) = "double"
unset($array[$foo]);
print_r($array);
Expected result:
----------------
Array()
Actual result:
--------------
Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62653&edit=1