Bug #81432 [NEW]: JIT bug (tracing mode only) with named arguments
From: julien dot boudry at gmail dot com
Operating system: Windows 10 + Linux (With Docker)
PHP version: 8.0.10
Package: JIT
Bug Type: Bug
Bug description:JIT bug (tracing mode only) with named arguments
Description:
------------
Hello,
I made many attempts to reproduce this bug in a theoretical way with a
very easily understandable PHP code. And my efforts did not succeed and
it must be used in the context of a rather heavy project.
However, with further effort to reproduce it, it is I believe quite
aberrant and easy to see just by following the trace. Since it mixes
variables passed to a function call in a totally impossible way.
* Occurs only in opcache.jit=tracing mode, but everything works fine
with opcache.jit=function, also works fine without JIT (with opcache
enabled or disabled).
* Does not seem to be able to be reproduced without the use of named
arguments. If I remove the named argument, everything works fine.
* Sometimes it works fine for no reason. Especially after a first run
(but not after a second run) after modifying a file, which seems to
point to a cache problem?
* Is not reproducible in PHP 8.1-RC1!
* Happens with 8.0.10 x64 NTS (tested on Windows and Linux (official PHP
Docker images on WSL2)
The details and means of reproduction are detailed here:
https://github.com/julien-boudry/Condorcet/issues/61
Test script:
---------------
https://github.com/julien-boudry/Condorcet/issues/61
Expected result:
----------------
Same result as without opcache.jit=tracing, not any error.
Actual result:
--------------
PHP Fatal error: Uncaught TypeError:
CondorcetPHP\Condorcet\Result::__construct(): Argument #6 ($seats) must
be of type ?int, CondorcetPHP\Condorcet\Election given, called in
C:\dev_scripts\Condorcet\lib\Algo\Method.php on line 84 and defined in
C:\dev_scripts\Condorcet\lib\Result.php:89
Stack trace:
#0 C:\dev_scripts\Condorcet\lib\Algo\Method.php(84):
CondorcetPHP\Condorcet\Result->__construct()
#1
C:\dev_scripts\Condorcet\lib\Algo\Methods\STV\SingleTransferableVote.php(91):
CondorcetPHP\Condorcet\Algo\Method->createResult()
#2 C:\dev_scripts\Condorcet\lib\Algo\Method.php(63):
CondorcetPHP\Condorcet\Algo\Methods\STV\SingleTransferableVote->compute()
#3 C:\dev_scripts\Condorcet\lib\ElectionProcess\ResultsProcess.php(80):
CondorcetPHP\Condorcet\Algo\Method->getResult()
#4 C:\dev_scripts\Condorcet\Dev\bugs\JitBug.php(37):
CondorcetPHP\Condorcet\Election->getResult()
#5 {main}
--
Edit bug report at https://bugs.php.net/bug.php?id=81432&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81432&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81432&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81432&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81432&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81432&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81432&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81432&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81432&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81432&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81432&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81432&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81432&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81432&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81432&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81432&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81432&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81432&r=mysqlcfg
Thread (8 messages)
- julien dot boudry at gmail dot com