-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix #80175: PHP8 RC1 - JIT Buffer not works #6268
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
Conversation
On Windows, `SUCCESSFULLY_REATTACHED` does not imply that the process has already been properly initialized; thus we must not skip some setup steps in `zend_jit_startup()`.
As it is now with Apache mpm_winnt, the control process is properly initialized for JIT, but the spawned request handler process is not. For FCGI, only the first php-cgi.exe process is properly initialized, but further processes are not. This causes null pointer accesses later on, because the By the way, having two Apache processes is also the reason why preloading wouldn't even work for Apache on Windows, @nikic. |
IMHO it is important to get this fixed for 8.0.0RC2 (which is scheduled for tagging on next Tuesday). If there's anything I can do to help with that, I could spend some time on that on the weekend. |
Can anyone confirm that it is working now? |
Did you build PHP from the latest Git snapshot? |
I downloaded (Build PHP nightly for windows) today from https://github.com/shivammathur/php-builder-windows Build Date: Oct 10 2020 23:38:27 --> Jit buffer size not works Update: Build Date: Oct 11 2020 23:38:24 --> Jit buffer size not works Update Build Date: Oct 19 2020 23:40:31 --> Jit buffer size still not working New Question: Maybe it is an apache issue? If yes, can anyone contact apache team to support jit? |
Bug #80175 | PHP8 RC1 - JIT Buffer not working Fixed with: 5998b2a |
This change appears to be the underlying cause of https://bugs.php.net/bug.php?id=81206. It would seem a more fine-grained fix for this problem is needed. |
I won't have time to look into this, but I generally recommend to not share OPcache instances between unrelated processes (that only happens on Windows); you can use opcache.cache_id to enforce this. |
In this case the processes aren't unrelated - I found the bug using phpstan, which uses subprocesses to parallelize static analysis, and which is crippled on JIT due to this change. |
The fix for bug 80175 (PR php#6268) broke most SAPIs wrt. JIT, most notably cgi-fcgi, because for these SAPIs `SUCCESSFULLY_REATTACHED` actually has to set the `reattached` flag.
On Windows,
SUCCESSFULLY_REATTACHED
does not imply that the processhas already been properly initialized; thus we must not skip some setup
steps in
zend_jit_startup()
.