[php-src] Issue #12481: PHP crash with JIT enabled
| From: | terax6669 | Date: | Thu, 19 Oct 2023 17:00:36 +0000 |
| Subject: | [php-src] Issue #12481: PHP crash with JIT enabled | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245610@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12481
Author: terax6669
### Description
I'm using google/protobuf v3.24.4.
The following code:
```php
<?php
$codedInputStream->readVarint32($value);
```
Resulted in: PHP process crash with exit code 5
Changing
$var &= 0xFFFFFFFF; to $var = $var & 0xFFFFFFFF; as well
as removing all the PHP_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)
### Operating System
Windows 11