Bug #68057 [Opn->Asn]: Incorrect parsing of big arrays in PHP 5.6.0
| From: | nikic@php.net | Date: | Fri, 19 Sep 2014 18:55:11 +0000 |
| Subject: | Bug #68057 [Opn->Asn]: Incorrect parsing of big arrays in PHP 5.6.0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187612@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68057&edit=1
ID: 68057
Updated by: nikic@php.net
Reported by: vostreltsov at gmail dot com
Summary: Incorrect parsing of big arrays in PHP 5.6.0
-Status: Open
+Status: Assigned
Type: Bug
Package: Arrays related
Operating System: Linux
PHP Version: 5.6.0
-Assigned To:
+Assigned To: bwoebi
Block user comment: N
Private report: N
New Comment:
Constant expression AST uses ushort child count in 5.6, which is overflowing here.
Previous Comments:
------------------------------------------------------------------------
[2014-09-19 18:45:28] mamontov dot dp at gmail dot com
Confirmed in Windows 8, using x86 non-thread-safe build.
------------------------------------------------------------------------
[2014-09-19 18:25:14] vostreltsov at gmail dot com
Forgot to mention that the problem appeared after upgrading from 5.5.X (don't remember the
exact version) to 5.6.0.
------------------------------------------------------------------------
[2014-09-19 18:20:54] vostreltsov at gmail dot com
Description:
------------
So in my project I have an auto-generated lexer, it contains a big array. I created a simplified
script that reproduces the bug.
There are 65538 integers and it looks like something overflows inside PHP. The var_dump call ouputs
an array of only the last 2 numbers.
Removing last 2 numbers yields an empty array.
If I remove last 3 numbers, the output stops at key 32766, that is 32767 values.
Test script:
---------------
http://filebin.ca/1atoDItGZU2A
Expected result:
----------------
All of 65538 integers
Actual result:
--------------
array(2) {
[0]=>
int(0)
[1]=>
int(0)
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68057&edit=1