Skip to content

Assertion violation in ZendAccelerator.c #15348

Closed

Description

@cmb69

Description

Even with a minimal x86 debug build on Windows, as soon as OPcache is enabled, php.exe always triggers an assertion violation.

buildconf && configure --disable-all --enable-cli --disable-debug-pack --enable-debug --disable-zts --enable-opcache --enable-test-ini && nmake
nmake run ARGS=-v

outputs

Assertion failed: ((uintptr_t)(accel_shared_globals->interned_strings).start & 0x7) == 0, file ext\opcache\ZendAccelerator.c, line 2880

ZEND_ASSERT(((uintptr_t)ZCSG(interned_strings).start & 0x7) == 0); /* should be 8 byte aligned */

Some relevant debug info:

&ZCSG(interned_strings)         0x200000c4
sizeof(zend_string_table)       0x18
hash_size+1                     0x80000
sizeof(zend_string_table_pos_t) 0x4
sizeof(zend_string)             0x14
ZCSG(interned_strings).start    0x2020017c

So it seems to me that sizeof(zend_string) doesn't meet the expectation of being a multiple of 8. No, the problem is more likely that &ZCSG(interned_strings) is not a multiple of 8.

I bisected this down to 1bae61a. @arnaud-lb, can you please clarify?

PHP Version

PHP 8.4

Operating System

Windows x86

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