-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Bug "Parameter 1 to ... expected to be a reference, value given" if nested function call #73
Comments
@ASchmidt1 Are you sure you are not running afoul of the changed handling of |
The code works as expected without uopz: https://3v4l.org/QXr3i |
@mszabo-wikia Confirmed with PHP 7.2.3. Without UOPZ extension, ONLY this code (using &$this) will work and NO issue warnings:
If you do NOT use a $this reference, then PHP 7.2.3 without UOPZ will return warnings: So native PHP works, and ONLY works, if &$this is used in BOTH lines. However, the moment UOPZ is active, that working PHP 7.2.3 code fails. |
Interesting. Based on PHP bug 73751 I'd have expected such usage of |
Running the code above is successful regardless of PHP version:
This issue specifically affects the greater Wordpress community, would love to help, but the comments are pretty terse regarding PHP_FUNCTION(uopz_call_user_func) Is it possible that the parameter copying in util.c (uopz_caller_init) is mutating the parameters, or when its copying the function from the hashtable, that it's losing some bit of metadata, such as that the parameter should be a reference? I also looked into the zpp api to see if it could be an issue with the zend data types, which I'm still not convinced couldn't be the issue. @krakjoe Do you have office hours to discuss? |
I and a colleague spent a good amount of time debugging this with gdb in hopes we could spot the issue. We even tried commenting out various bits of functionality we suspected within UOPZ, such as the callers_init bits that perform the memcpy, and much more. Each time we reran the test by @ASchmidt1 above on Php7.2, it failed, but building the same code against the Zend libs in 7.0 seems to pass. Dockerfile:
After running
At this point, we suspect that UOPZ could be exposing a bug within Zend, but don't have a definitive example that proves it. We see Zend calls in the backtraces within gdb while calling the mostly commented out bits of UOPZ, which still produces failures on php7.2. |
The following code:
will result in:
The text was updated successfully, but these errors were encountered: