mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
![]() When a first PHP process launches, Opcache creates a shared file mapping to use as a shm region. The size of this mapping is set by opcache.memory_consumption. When a new PHP process launches while the old one is still running, Opcache tries to reattach to the shm. When reattaching it tries to map the requested size (i.e. set by opcache.memory_consumption). However, if the new requested size is larger than the size used in the original file mapping, then the call to VirtualProtect() will fail and the new PHP process will fail to launch. It's not possible to resize the virtual region on Windows, unless relying on undocumented APIs like `NtExtendSection` but then we would sitll need to communicate that to the first process. This issue is the root cause of Psalm end-to-end tests failing in GH-18417: Psalm estimates the required memory sizes and relaunches itself with more memory requested, if its estimate is below the currently allocated shared memory. This causes a crash on startup and the tests fail. To solve this, we need to make the mappings unique per requested size. There are two ideas: 1. Include in zend_system_id. However, this also affects other things and may be too overkill. 2. Include it in the filename, this is an easy local change. I went with this option. Closes GH-18443. |
||
---|---|---|
.. | ||
jit | ||
tests | ||
config.m4 | ||
config.w32 | ||
CREDITS | ||
opcache.stub.php | ||
opcache_arginfo.h | ||
shared_alloc_mmap.c | ||
shared_alloc_posix.c | ||
shared_alloc_shm.c | ||
shared_alloc_win32.c | ||
zend_accelerator_blacklist.c | ||
zend_accelerator_blacklist.h | ||
zend_accelerator_debug.c | ||
zend_accelerator_debug.h | ||
zend_accelerator_hash.c | ||
zend_accelerator_hash.h | ||
zend_accelerator_module.c | ||
zend_accelerator_module.h | ||
zend_accelerator_util_funcs.c | ||
zend_accelerator_util_funcs.h | ||
zend_file_cache.c | ||
zend_file_cache.h | ||
zend_persist.c | ||
zend_persist.h | ||
zend_persist_calc.c | ||
zend_shared_alloc.c | ||
zend_shared_alloc.h | ||
ZendAccelerator.c | ||
ZendAccelerator.h |