-
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 crash with JIT enabled #12481
Comments
Sorry, I'm not able to analyse the problem without a reproduction case. |
@dstogov Some additional context:
|
Sorry for the long delay. |
I finally got the docker working, but I can't reproduce the crash with the provided script. Not with PHP master nor with PHP-8.2 HEAD (8.2.15-dev NTS DEBUG build). May be the bug has been already fixed. @terax6669 Could you please check if you still can reproduce the problem with PHP-8.2 branch. |
@danog could you please also try to reproduce this problem |
@dstogov Tried and could not reproduce on 8.2, master and 8.2.11, both with the usual jit_bugs config and the config specified here. Maybe it's caused by some windows-specific JIT code? I did test on linux after all... |
@danog thanks for the confirmation. |
Yes it's on Windows, I don't have a real linux environment. I can try running it under WSL if you'd like me to verify that it also happens there. I downloaded these:
and ran |
The reduced test case (crashes only on Windows 64). <?php
function foo(&$var) {
$var &= 0xFFFFFFFF;
return intval($var);
}
$v = 0x7FFFFFFF1;
for ($i = 0; $i < 100; $i++) {
foo($v);
} |
* PHP-8.2: Fix GH-12481: PHP crash with JIT enabled
* PHP-8.3: Fix GH-12481: PHP crash with JIT enabled
Description
I'm using google/protobuf v3.24.4.
The following code:
Resulted in: PHP process crash with exit code 5
Changing
$var &= 0xFFFFFFFF;
to$var = $var & 0xFFFFFFFF;
as well as removing all thePHP_INT_SIZE
conditions resolves the issue.The error doesn't always occur in the same place (it's somewhat random +- a few lines/loops), but can be consistently reproduced. Also it seems to only occur when you do it very fast in a loop enough times. Adding a bunch of debug output slowed down my console to the point where the error did not occur anymore and the process successfully finished.
Not sure how else I could help reproduce the issue on your side, I'm not at liberty to share the data I'm processing.
PHP Version
PHP 8.2.11 (cli) (built: Sep 26 2023 15:25:31) (ZTS Visual C++ 2019 x64)
PHP 8.3.1 (cli) (built: Dec 20 2023 14:06:10) (ZTS Visual C++ 2019 x64)
PHP 8.3.1 (cli) (built: Dec 20 2023 14:06:30) (NTS Visual C++ 2019 x64)
Operating System
Windows 11
The text was updated successfully, but these errors were encountered: