Open YuanchengJiang opened 3 weeks ago
Looks related to #15658.
Semi-automatically reduced to:
<?php
namespace NS { // Namespace is important to reproduce the issue
class Tester {
static public function findExecutable(): string {
for ($i = 0; $i < 2; $i++) {
// Need this loop to reproduce
}
return dirname(__DIR__);
}
}
}
namespace {
NS\Tester::findExecutable();
}
Or with opcache.jit=1111
:
<?php
namespace NS { // Namespace is important to reproduce the issue
class Tester {
static public function findExecutable(): string {
return dirname(__DIR__);
}
}
}
namespace {
NS\Tester::findExecutable();
}
It's again related to FLFs.
ZEND_INIT_NS_FCALL_BY_NAME VM handler is called with opline->opcode == JMP_FRAMELESS
and pointing at the wrong cache slot as a consequence.
I think the JIT should generate a move to %r15
with the right opline in both possible successor blocks of JMP_FRAMELESS, but I'm not sure how to do that properly. Using zend_jit_reset_last_valid_opline
in zend_jit_jmp_frameless
doesn't work because the following code resets the last valid opline:
cc @dstogov I'm not sure how to fix this, I would need some input to know how to tackle this issue please.
I don't know this new code...
It looks like JIT code generated by zend_jit_jmp_frameless()
doesn't update EX(opline)
.
Actually JIT with optimization_level=1 shouldn't generate the complex code at all.
cc @iluuu1994
Description
The following code:
Resulted in this output:
To reproduce:
tester.inc:
PHP Version
PHP 8.4.0-dev
Operating System
ubuntu 22.04