Bug #81512 [Com]: Unexpected behavior with arrays and JIT
| From: | s dot pankratoff at gmail dot com | Date: | Mon, 25 Oct 2021 16:41:51 +0000 |
| Subject: | Bug #81512 [Com]: Unexpected behavior with arrays and JIT | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-237368@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81512&edit=1
ID: 81512
Comment by: s dot pankratoff at gmail dot com
Reported by: timuradilev at gmail dot com
Summary: Unexpected behavior with arrays and JIT
Status: Closed
Type: Bug
Package: JIT
Operating System: Ubuntu 20.04.3
PHP Version: 8.0.11
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Hello!
I can't see this fix in 8.0.12 update. Is there any plans to include it in 8.0 branch or it
will be only in 8.1?
Thanks!
Previous Comments:
------------------------------------------------------------------------
[2021-10-07 18:29:32] git@php.net
Automatic comment on behalf of dstogov
Revision: https://github.com/php/php-src/commit/b47a48ff80fdade1f7f44b906da27ea18061464b
Log: Fixed bug #81512 (Unexpected behavior with arrays and JIT)
------------------------------------------------------------------------
[2021-10-07 14:10:17] nikic@php.net
I can reproduced on 8.0 but not on 8.1.
------------------------------------------------------------------------
[2021-10-07 13:55:16] timuradilev at gmail dot com
Description:
------------
We migrated from php 7.4 to 8 and encountered an issue.
In mongodb/mongo-php-library there is the function 'is_pipeline' that checks that the
given argument is the correct pipeline. This function started to return false for correct pipelines.
I reduced the function. See the test script section.
To reproduce the behavior run the test script with opcache.enable_cli=1 and opcache.jit=tracing.
Optimization flags 0052 also trigger the issue.
We think it may be due to the "Inline VM handlers" option.
Test script:
---------------
$pipe = [['val1'],['val2'],];
for ($i = 0; $i < 30; ++$i) {
echo "$i ";
if (!is_pipeline($pipe)) {
echo 'ERROR ';
}
}
function is_pipeline($pipeline): bool {
foreach ($pipeline as $stage) {
if (!is_array($stage)) {
return false; // must never happen
}
$stage = (array) $stage;
reset($stage);
}
return true;
}
Expected result:
----------------
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Actual result:
--------------
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ERROR 22 ERROR 23 ERROR 24 ERROR 25 ERROR 26
ERROR 27 ERROR 28 ERROR 29 ERROR
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81512&edit=1