-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP crashes when execute_ex is overridden and a __call trampoline is used from internal code #10072
Comments
@iluuu1994, @bwoebi, would you have an idea what this could be? |
This seems right. The issue can be reproduced by calling a trampoline from any native code, as long as execute_ex is overridden:
I think that the effect of the first two first statements in
is never used:
A custom There is a similar sequence in We could remove these two lines, or skip |
Xdebug definitely uses I'll make a PR to not call |
…ll trampoline is used from internal code
Description
This is reproducible by first installing this extension, which pretty much only sets up a dummy overload of zend_execute_ex.
Then run the code below (by @Girgias), with the following command:
This crashes with the following back trace:
What seems to happen here is that the
LOAD_OPLINE
tries to accessopline
fromprev_execute_data
(line 3458 setsexecute_data
toprev_execute_data
, which is NULL in this case. The code inzend_vm_def.h
is:I guess that there is no
prev_execute_data
, as this is called when cleaning up the stream resource, which isn't run from user land.If you change line 3450 (and regenerate the executor with
Zend/zend_vm_gen.php
) to:Then the crash is gone, but the overloaded
zend_execute_ex
is not run. In Xdebug, that results in the__call
line forstream_close
to be missing in a function trace. You can see that in this sample, where the__call
is there forstream_open
, but not forstream_close
.So although the one line patch fixes the crash, it does not fix the issue.
I haven't figured out what the correct fix is.
PHP Version
PHP 8.1.15-dev, but also reproducible with PHP 8.2.1-dev
Operating System
Debian unstable, but it is not relevant
The text was updated successfully, but these errors were encountered: