Bug #80839 [NEW]: PHP problem with JIT
| From: | gfpuba+phpbug at gmail dot com | Date: | Sat, 06 Mar 2021 00:21:31 +0000 |
| Subject: | Bug #80839 [NEW]: PHP problem with JIT | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232590@lists.php.net to get a copy of this message | ||
From: gfpuba+phpbug at gmail dot com
Operating system: Windows 10
PHP version: 8.0Git-2021-03-06 (Git)
Package: JIT
Bug Type: Bug
Bug description:PHP problem with JIT
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 bug report at https://bugs.php.net/bug.php?id=80839&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80839&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80839&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80839&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80839&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80839&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80839&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80839&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80839&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80839&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80839&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80839&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80839&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80839&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80839&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80839&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80839&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80839&r=mysqlcfg