Bug #79743 [NEW]: Fatal error when assigning to array property with JIT enabled
| From: | theodorejb@php.net | Date: | Fri, 26 Jun 2020 14:50:10 +0000 |
| Subject: | Bug #79743 [NEW]: Fatal error when assigning to array property with JIT enabled | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227691@lists.php.net to get a copy of this message | ||
From: theodorejb
Operating system: Windows 10 x64 build 2004
PHP version: 8.0.0alpha1
Package: opcache
Bug Type: Bug
Bug description:Fatal error when assigning to array property with JIT enabled
Description:
------------
Running php-8.0.0alpha1-nts-Win32-vs16-x64
JIT settings:
opcache.jit_buffer_size=200000000
opcache.jit=1235
When an array contains a bunch of objects with a typed array property,
and the objects are looped over and a value is assigned to a
non-consecutive key in the typed array property, a fatal error occurs
after a few iterations.
Note: I wasn't able to reproduce the error if the array contains 30 or
fewer objects. It only seems to occur when there are at least 31
objects, and the more objects are in the array the fewer iterations are
successful before the error occurs.
Test script:
---------------
<?php
class Foo
{
public array $things = [];
}
$objects = [];
for ($i = 0; $i < 70; $i++) {
$objects[] = new Foo();
}
foreach ($objects as $key => $class) {
echo $key . '<br/>';
$class->things[1] = true;
}
Actual result:
--------------
Fatal error: Uncaught TypeError: Cannot auto-initialize an array inside
property Foo::$things of type array in test.php:16 Stack trace: #0
{main} thrown in test.php on line 16
--
Edit bug report at https://bugs.php.net/bug.php?id=79743&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79743&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79743&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79743&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79743&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79743&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79743&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79743&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79743&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79743&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79743&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79743&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79743&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79743&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79743&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79743&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79743&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79743&r=mysqlcfg