You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpclass A {
private$_prop;
public$prop {
get => $this->_prop;
}
}
for ($i=0;$i<2;$i++)
echo (newA)->prop;
using opcache.jit=1101
Resulted in this output:
Segfault
But I expected this output instead:
No segfault
I analysed this and this is a different bug related to a cache slot optimization.
As far as I understand, this happens for when the cache slot satisfies the ZEND_IS_PROPERTY_HOOK_SIMPLE_GET condition. Then we set up a function call frame and re-enter the VM to execute the hook function:
This seems incompatible with how the minimal JIT works, getting the property will be skipped.
Indeed if we get rid of ZEND_SET_PROPERTY_HOOK_SIMPLE_GET in zend_object_handlers.c or go to a higher optimization level the problem disappears. I'm not sure yet how to solve that.
PHP Version
master
Operating System
Linux
The text was updated successfully, but these errors were encountered:
…al JIT
The FETCH_OBJ_R VM handler has an optimization that directly enters into
a hook if it is a simpler getter hook. This is not compatible with the
minimal JIT because the minimal JIT will try to continue executing the
opcodes after the FETCH_OBJ_R.
To solve this, we check whether the opcode is still the expected one
after the execution of the VM handler. If it is not, we know that we are
going to execute a simple hook. In that case, exit to the VM.
…al JIT
The FETCH_OBJ_R VM handler has an optimization that directly enters into
a hook if it is a simpler getter hook. This is not compatible with the
minimal JIT because the minimal JIT will try to continue executing the
opcodes after the FETCH_OBJ_R.
To solve this, we check whether the opcode is still the expected one
after the execution of the VM handler. If it is not, we know that we are
going to execute a simple hook. In that case, exit to the VM.
Description
Originally posted in #15819 (comment)
The following code:
using
opcache.jit=1101
Resulted in this output:
But I expected this output instead:
I analysed this and this is a different bug related to a cache slot optimization.
As far as I understand, this happens for when the cache slot satisfies the
ZEND_IS_PROPERTY_HOOK_SIMPLE_GET
condition. Then we set up a function call frame and re-enter the VM to execute the hook function:php-src/Zend/zend_vm_def.h
Lines 2094 to 2126 in 7c2204c
This seems incompatible with how the minimal JIT works, getting the property will be skipped.
Indeed if we get rid of
ZEND_SET_PROPERTY_HOOK_SIMPLE_GET
inzend_object_handlers.c
or go to a higher optimization level the problem disappears. I'm not sure yet how to solve that.PHP Version
master
Operating System
Linux
The text was updated successfully, but these errors were encountered: