[php-src] Issue #15490: Member access within misaligned address in ext/opcache/jit/zend_jit.c
| From: | YuanchengJiang | Date: | Mon, 19 Aug 2024 06:12:57 +0000 |
| Subject: | [php-src] Issue #15490: Member access within misaligned address in ext/opcache/jit/zend_jit.c | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247527@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/15490
Author: YuanchengJiang
### Description
The following code:
```php
<?php
for ($i = 0; $i < 100; $i++) {
UniqueListLast::bar();
}
for ($i = 0; $i < 100; $i++) {
new UniqueListLast();
}
?>
```
Resulted in this output:
```
/php-src/ext/opcache/jit/zend_jit.c:2788:21: runtime error: member access within misaligned address
0x000500000004 for type 'zend_call_info' (aka 'struct _zend_call_info'), which
requires 8 byte alignment
0x000500000004: note: pointer points here
<memory cannot be printed>
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/opcache/jit/zend_jit.c:2788:21
```
To reproduce:
```
php -d "extension_dir=/php-src/modules/" -d
"zend_extension=/php-src/modules/opcache.so" -d
"opcache.preload=./gh8461-007.inc" -d "opcache.enable=1" -d
"opcache.enable_cli=1" -d "opcache.jit=1235" ./test.php
```
gh8461-007.inc is at ext/opcache/tests/jit/gh8461-007.inc
### PHP Version
PHP 8.4.0-dev
### Operating System
ubuntu 22.04