You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opcache_reset will sometimes lead to memory corruptions in ZTS under high concurrency.
The bug was first raised in this issue in the FrankenPHP repo. The reproducer from that issue will cause a opcache_reset after a few thousand requests under load. I'm not sure why an opcache reset is forced, it could be caused by inline classes filling up the opcache.interned_strings_buffer.
The main issue seems to be though that if multiple threads are executing scripts simultaneously, it will sometimes lead to weird opcache issues and result in a zend_mm_heap corrupted when an opcache_reset is scheduled.
For reference: FrankenPHP uses the bookworm ZTS docker image and runs PHP with 1 process and multiple threads
PHP Version
PHP 8.4.5 (cli) (built: Mar 17 2025 23:15:56) (ZTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.4.5, Copyright (c) Zend Technologies
with Zend OPcache v8.4.5, Copyright (c), by Zend Technologies
Operating System
debian-bookworm (Docker)
The text was updated successfully, but these errors were encountered:
@nielsdos is it possible to disable the interned_strings_buffer? I'm still looking into why it's filling up to the point of forcing a reset, but it only seems to happen in that specific reproducer and only under concurrency.
Description
opcache_reset
will sometimes lead to memory corruptions in ZTS under high concurrency.The bug was first raised in this issue in the FrankenPHP repo. The reproducer from that issue will cause a
opcache_reset
after a few thousand requests under load. I'm not sure why an opcache reset is forced, it could be caused by inline classes filling up theopcache.interned_strings_buffer
.The main issue seems to be though that if multiple threads are executing scripts simultaneously, it will sometimes lead to weird opcache issues and result in a
zend_mm_heap corrupted
when anopcache_reset
is scheduled.I also created a smaller reproducer that will force the issue with a dev version of PHP installed here:
https://github.com/AlliBalliBaba/zts-opcache-reset-reproducer
For reference: FrankenPHP uses the bookworm ZTS docker image and runs PHP with 1 process and multiple threads
PHP Version
Operating System
debian-bookworm (Docker)
The text was updated successfully, but these errors were encountered: