|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-03-25 09:27 UTC] gajowy at agzeta dot pl
Description:
------------
When JIT mode is enabled, running child process using proc_open causes crash in CLI mode with VirtualError message.
Test script:
---------------
1. Set opcache.jit_buffer_size=100M in php.ini
2. Run following script in CLI mode:
$proc=proc_open('php.exe',[],$pipes,NULL,NULL,['bypass_shell'=>TRUE]);
print_r( proc_get_status($proc) );
proc_terminate($proc);
Expected result:
----------------
Array
(
[command] => php.exe
[pid] => 13620
[running] => 1
[signaled] =>
[stopped] =>
[exitcode] => -1
[termsig] => 0
[stopsig] => 0
)
Actual result:
--------------
Thu Mar 25 10:20:55 2021 (1612): Fatal Error VirtualProtect() failed
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
At least as workaround, enforce separate OPcache instances by using opcache.cache_id[1]. In this case $proc=proc_open('php.exe -dopcache.cache_id=123',[],$pipes,NULL,NULL,['bypass_shell'=>TRUE]); [1] <https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.cache-id>This may fix it, but I donot know if it's proper or why donot do this. diff --git a/ext/opcache/shared_alloc_win32.c b/ext/opcache/shared_alloc_win32.c index f7ba4effb3..51b1679867 100644 --- a/ext/opcache/shared_alloc_win32.c +++ b/ext/opcache/shared_alloc_win32.c @@ -72,7 +72,7 @@ static void zend_win_error_message(int type, char *msg, int err) static char *create_name_with_username(char *name) { static char newname[MAXPATHLEN + 32 + 4 + 1 + 32 + 21]; - snprintf(newname, sizeof(newname) - 1, "%s@%.32s@%.20s@%.32s", name, accel_uname_id, sapi_module.name, zend_system_id); + snprintf(newname, sizeof(newname) - 1, "%s@%.32s@%.20s@%.32s@%d", name, accel_uname_id, sapi_module.name, zend_system_id, GetCurrentProcessId()); return newname; }