Skip to content

Member access within misaligned address in ext/opcache/jit/zend_jit.c #15490

Closed

Description

@YuanchengJiang

Description

The following code:

<?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

Activity

  1. cmb69 commented on Aug 19, 2024

    @cmb69
    Member

    See also #15481.

  2. added a commit that references this issue on Aug 26, 2024
    b839c5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions