Bug #80839 [Opn->Ver]: PHP problem with JIT
| From: | nikic@php.net | Date: | Wed, 17 Mar 2021 10:06:22 +0000 |
| Subject: | Bug #80839 [Opn->Ver]: PHP problem with JIT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232807@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80839&edit=1
ID: 80839
Updated by: nikic@php.net
Reported by: gfpuba+phpbug at gmail dot com
Summary: PHP problem with JIT
-Status: Open
+Status: Verified
Type: Bug
Package: JIT
Operating System: Windows 10
PHP Version: 8.0Git-2021-03-06 (Git)
-Assigned To:
+Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Asserts under -d opcache.jit=function:
php: /home/nikic/php/php-8.0/Zend/zend_variables.c:65: zend_string_destroy: Assertion
`zend_gc_refcount(&(str)->gc) == 0' failed.
Previous Comments:
------------------------------------------------------------------------
[2021-03-06 00:21:31] gfpuba+phpbug at gmail dot com
Description:
------------
Running this program results in invalid data.
May also causes PHP to crash.
Works fine without JIT.
The problem has been narrowed as best as I can.
The original problem was a PHP crash using JIT in a much larger application.
Fails the same in Apache 2.4 or CLI (both 64bits)
Test script:
---------------
<?php
$a = null; // the problem only occurs when set to NULL
test($a, 'y');
function test($str, $pad) {
$x = $str . str_repeat($pad, 15); // $x now contains "yyyyyyyyyyyyyyy"
var_dump($x);
echo '<br/>';
$gft = new gft();
$gft->info(33);
// $x has been changed ????
// $x contains what was echoed in the function 'info'
var_dump($x);
echo '<br/>';
}
class gft{
private $strVal = 'abcd ';
public function info($info, $prefix = ' Info:'){
echo $this->strVal.$prefix.serialize($info).'aaaa';
echo '<br/>';
}
}
Expected result:
----------------
string(15) "yyyyyyyyyyyyyyy"
xxxx Info:i:33;aaaa
string(15) "yyyyyyyyyyyyyyy"
Actual result:
--------------
string(15) "yyyyyyyyyyyyyyy"
xxxx Info:i:33;aaaa
string(19) "xxxx Info:i:33;aaaa"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80839&edit=1