Bug #79535 [Com]: PHP crashes with specific opcache.optimization_level

From: Date: Wed, 29 Apr 2020 11:22:45 +0000
Subject: Bug #79535 [Com]: PHP crashes with specific opcache.optimization_level
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226821@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79535&edit=1

 ID:                 79535
 Comment by:         roland at nextendweb dot com
 Reported by:        roland at nextendweb dot com
 Summary:            PHP crashes with specific opcache.optimization_level
 Status:             Open
 Type:               Bug
 Package:            opcache
 Operating System:   Windows, Linux
 PHP Version:        7.3.17
 Block user comment: N
 Private report:     N

 New Comment:

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...


Previous Comments:
------------------------------------------------------------------------
[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


Thread (17 messages)

« previous php.bugs (#226821) next »