Bug #80802 [Asn->Csd]: zend_jit_fetch_indirect_var assert failure with tracing JIT
| From: | dmitry@php.net | Date: | Mon, 01 Mar 2021 21:01:09 +0000 |
| Subject: | Bug #80802 [Asn->Csd]: zend_jit_fetch_indirect_var assert failure with tracing JIT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232463@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80802&edit=1
ID: 80802
Updated by: dmitry@php.net
Reported by: dktapps at pmmp dot io
Summary: zend_jit_fetch_indirect_var assert failure with
tracing JIT
-Status: Assigned
+Status: Closed
Type: Bug
Package: JIT
Operating System: Linux
PHP Version: 8.0Git-2021-02-25 (Git)
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=957cb13a4959ed6a802508f14317253bf06f82cd
Log: Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)
Previous Comments:
------------------------------------------------------------------------
[2021-02-25 22:24:25] dktapps at pmmp dot io
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 this bug report at https://bugs.php.net/bug.php?id=80802&edit=1