Conversation
This can happen due to missing SAVE_OPLINE() in the VM
|
This will slow down the VM somewhat, although it's hard to say whether that makes a big difference without measuring. Essentially any handler that allocates memory could potentially throw out-of-memory errors, which are likely most of them. AFAIK the main reason for the php-src/Zend/zend_exceptions.c Lines 216 to 217 in eb83e02 The out of memory errors just do Please let me know if there's something I'm missing! |
This is a follow up to #9933 / #10003
SAVE_OPLINE() is used to save the register variable
oplinein EX(opline). It appears to have at least these purposes:zend_error() will crash if EX(opline) was not saved. zend_vm_def.h appears to consistenly save opline before anything that may trigger an error, but does not always account for the fact that memory allocations may trigger an error.
In this change I'm adding an assertion in emalloc functions to ensure that opline was saved, and a few missing SAVE_OPLINE() that the assertion helped to discover.
There is a remaining crash in jit_exit that I need to investigate. I also need to update zend_jit_arm64.dasc.