Edit report at https://bugs.php.net/bug.php?id=79535&edit=1
ID: 79535
Updated by: cmb@php.net
Reported by: roland at nextendweb dot com
Summary: PHP crashes with specific opcache.optimization_level
-Status: Assigned
+Status: Open
Type: Bug
Package: opcache
Operating System: Windows, Linux
PHP Version: 7.3.17
-Assigned To: cmb
+Assigned To:
Block user comment: N
Private report: N
New Comment:
When file_cache is enabled, and you switch Xdebug on and off,
crashes are to be expected. That issue has already been reported
as bug #75886.
Previous Comments:
------------------------------------------------------------------------
[2020-04-29 15:39:44] roland at nextendweb dot com
Xdebug is disabled when this crash happens.
Here is the phpinfo() related to opcache:
opcache.blacklist_filename no value
opcache.consistency_checks 0
opcache.dups_fix Off
opcache.enable On
opcache.enable_cli Off
opcache.enable_file_override Off
opcache.error_log no value
opcache.file_cache no value
opcache.file_cache_consistency_checks 1
opcache.file_cache_fallback 1
opcache.file_cache_only 0
opcache.file_update_protection 2
opcache.force_restart_timeout 60
opcache.interned_strings_buffer 8
opcache.log_verbosity_level 1
opcache.max_accelerated_files 8192
opcache.max_file_size 0
opcache.max_wasted_percentage 5
opcache.memory_consumption 512
opcache.mmap_base no value
opcache.opt_debug_level 0
opcache.optimization_level 0xfffffbbf
opcache.preferred_memory_model no value
opcache.protect_memory 0
opcache.restrict_api no value
opcache.revalidate_freq 10
opcache.revalidate_path Off
opcache.save_comments 1
opcache.use_cwd On
opcache.validate_permission Off
opcache.validate_timestamps On
------------------------------------------------------------------------
[2020-04-29 15:34:52] cmb@php.net
Just to be sure: are there Xdebug and file_cache(_fallback)
involved?
------------------------------------------------------------------------
[2020-04-29 11:22:45] roland at nextendweb dot com
I'm not sure if it help, but changing:
protected function newFormatter() {
return new $className;
}
to
protected function newFormatter() {
return new Compressed;
}
seems to solve the issue, but it might be unrelated...
------------------------------------------------------------------------
[2020-04-29 10:44:47] roland at nextendweb dot com
Description:
------------
I was able to reproduce the crash with PHP 7.3.17 on Linux and PHP 7.3.3 on Windows.
I have a Joomla installation with some extensions installed. The crash comes when
opcache.optimization_level has the following values:
0xfffffaaf
0xfffffabf
0xfffffbbf
0xfffffbaf
The same crash does not happen if
- opcode cache disabled
- xdebug and opcode cache enabled
- opcode cache enabled and opcache.optimization_level has the following values:0xfffffa9f,
0xfffffadf, 0xfffffacf, 0xfffffccf, 0xfffffbcf, 0xffffffff
On PHP 7.3.3 Windows has no response in the browser the apache log says:
[mpm_winnt:notice] [pid 7112:tid 572] AH00428: Parent: child process 25244 exited with status
3221225477 -- Restarting.
On PHP 7.3.17 there was the last opened output buffer printed on the screen and functions with
register_shutdown_function gets called.
WinDBG shows the following:
(5e9c.41f4): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
php7ts!object_and_properties_init+0xd:
00007ffb798945ed 8b421c mov eax,dword ptr [rdx+1Ch]
ds:000000000000001b=????????
0:225> g
(5e9c.41f4): Access violation - code c0000005 (!!! second chance !!!)
php7ts!object_and_properties_init+0xd:
00007ffb798945ed 8b421c mov eax,dword ptr [rdx+1Ch]
ds:000000000000001b=????????
0:225> g
(5e9c.41f4): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
php7ts!object_and_properties_init+0xd:
00007ffb798945ed 8b421c mov eax,dword ptr [rdx+1Ch]
ds:000000000000001b=????????
Call stack:
php7ts!object_and_properties_init+0xd
php7ts!zend_objects_clone_members+0xa00
php7ts!execute_ex+0x5f
php7ts!zend_call_function+0x2d0
php7ts!php_prefix_varname+0xdcfa
php7ts!zend_exception_set_previous+0xecc
php7ts!execute_ex+0x5f
php7ts!zend_execute+0x1a8
php7ts!zend_execute_scripts+0xb9
php7ts!php_execute_script+0x261
php7apache2_4+0x3df1
libhttpd!ap_run_handler+0x35
libhttpd!ap_invoke_handler+0x10f
libhttpd!ap_internal_redirect_handler+0x29a
libhttpd!ap_process_request+0xf
mod_http2+0x18822
mod_http2+0x18684
libhttpd!ap_run_process_connection+0x35
mod_http2+0x183e8
mod_http2+0x1c58e
ucrtbase!thread_start<unsigned int (__cdecl*)(void *),1>+0x42
KERNEL32!BaseThreadInitThunk+0x14
ntdll!RtlUserThreadStart+0x21
I was unable to create test script as I'm not sure what could be the cause and the current
environment is too complex.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79535&edit=1