Bug #80802 [NEW]: zend_jit_fetch_indirect_var assert failure with tracing JIT
| From: | dktapps at pmmp dot io | Date: | Thu, 25 Feb 2021 22:24:25 +0000 |
| Subject: | Bug #80802 [NEW]: zend_jit_fetch_indirect_var assert failure with tracing JIT | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232389@lists.php.net to get a copy of this message | ||
From: dktapps at pmmp dot io
Operating system: Linux
PHP version: 8.0Git-2021-02-25 (Git)
Package: JIT
Bug Type: Bug
Bug description:zend_jit_fetch_indirect_var assert failure with tracing JIT
Description:
------------
In code involving inherited static properties, an assert failure may be
triggered in the JIT.
This is reproducible on 8.0.3RC1 and PHP-8.0 branch as of 2020-02-25,
with a build using `--disable-all --enable-cli --enable-debug
--enable-opcache --enable-opcache-jit`.
Run the below script with the following INI settings
opcache.jit=tracing
opcache.jit_buffer_size=1M
opcache.enable_cli=1
Test script:
---------------
<?php
abstract class AsyncTask{
private static $threadLocalStorage = null;
protected function storeLocal(string $key, $complexData) : void{
if(self::$threadLocalStorage === null){
self::$threadLocalStorage = new \ArrayObject();
}
self::$threadLocalStorage[spl_object_id($this)][$key] = $complexData;
}
final public function __destruct(){
$this->reallyDestruct();
if(self::$threadLocalStorage !== null and
isset(self::$threadLocalStorage[$h = spl_object_id($this)])){
unset(self::$threadLocalStorage[$h]);
if(self::$threadLocalStorage->count() === 0){
self::$threadLocalStorage = null;
}
}
}
protected function reallyDestruct() : void{
}
}
class Task extends AsyncTask{
public function __construct(){
$this->storeLocal("thing1", new stdClass);
}
}
for($i = 0; $i < 10000; ++$i){
new Task;
}
echo "OK\n";
Expected result:
----------------
OK
Actual result:
--------------
Using php-src@8813f2e0c31a98828cac4570673ccd8ce79b00af:
php: /home/user/php-src-8.0/ext/opcache/jit/zend_jit_x86.dasc:15224:
zend_jit_fetch_indirect_var: Assertion `var_info & (1 << var_type)'
failed.
Aborted (core dumped)
--
Edit bug report at https://bugs.php.net/bug.php?id=80802&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80802&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80802&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80802&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80802&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80802&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80802&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80802&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80802&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80802&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80802&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80802&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80802&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80802&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80802&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80802&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80802&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80802&r=mysqlcfg