Bug #77647 [Opn]: preload: Access violation in zend_mm_shutdown
| From: | nikic@php.net | Date: | Mon, 29 Apr 2019 10:00:06 +0000 |
| Subject: | Bug #77647 [Opn]: preload: Access violation in zend_mm_shutdown | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-220647@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77647&edit=1
ID: 77647
Updated by: nikic@php.net
Reported by: mberchtold at gmail dot com
Summary: preload: Access violation in zend_mm_shutdown
Status: Open
Type: Bug
Package: opcache
Operating System: Windows 10 x64
PHP Version: master-Git-2019-02-21 (snap)
Block user comment: N
Private report: N
New Comment:
That's weird, this call is happening as part of an SHM_UNPROTECT region and shouldn't
generate an access violation :/
Previous Comments:
------------------------------------------------------------------------
[2019-04-16 06:55:14] mberchtold at gmail dot com
With
opcache.protect_memory=1
and the latest snapshot, I get the following crash now:
[Inline Frame] php_opcache.dll!accel_interned_strings_save_state() Line 416 C
php_opcache.dll!accel_use_shm_interned_strings() Line 749 C
php_opcache.dll!accel_post_startup() Line 2986 C
[Inline Frame] php8.dll!zend_post_startup() Line 992 C
php8.dll!php_module_startup(_sapi_module_struct * sf, _zend_module_entry * additional_modules,
unsigned int num_additional_modules) Line 2337 C
php-cgi.exe!php_cgi_startup(_sapi_module_struct * sapi_module) Line 969 C
php-cgi.exe!main(int argc, char * * argv) Line 1916 C
> [Inline Frame] php-cgi.exe!invoke_main() Line 78 C++
php-cgi.exe!__scrt_common_main_seh() Line 288 C++
kernel32.dll!BaseThreadInitThunk() Unknown
ntdll.dll!RtlUserThreadStart() Unknown
code:
static void accel_interned_strings_save_state(void)
{
ZCSG(interned_strings).saved_top = ZCSG(interned_strings).top;
}
debug out:
Unhandled exception thrown: write access violation.
**accel_shared_globals** was 0x100000000080.
------------------------------------------------------------------------
[2019-04-15 13:38:23] nikic@php.net
Support for opcache.protect_memory=1 on Windows has landed in the meantime, so it might be possible
to produce a better trace now. (Assuming that ext/phar is not used, which is not compatible with
memory protection right now.)
------------------------------------------------------------------------
[2019-03-23 10:31:15] nikic@php.net
Thanks for checking! Unfortunately it's hard to do anything here, as a segfault during memory
manager shutdown just indicates that memory manager data structures were corrupted at some point,
but doesn't really tell us where.
This is the point where I'd usually suggest to set opcache.protect_memory=1, but after checking
the code this functionality is currently implemented using mprotect() only and has no
VirtualProtect() support, so it won't actually do anything on Windows. We should probably add
that to make debugging opcache issues easier on Windows...
------------------------------------------------------------------------
[2019-03-23 01:04:58] mberchtold at gmail dot com
The stack trace:
> VCRUNTIME140.dll!memset_repmovs() Line 67 Unknown
php8.dll!00007ffc60cabd45() Unknown
php-cgi.exe!00007ff77d6a1763() Unknown
php-cgi.exe!00007ff77d6a40f8() Unknown
kernel32.dll!BaseThreadInitThunk() Unknown
ntdll.dll!RtlUserThreadStart() Unknown
But for some reason, the debug symbols (in the debug-pack) aren't matching the binaries.
------------------------------------------------------------------------
[2019-03-23 00:42:55] mberchtold at gmail dot com
Yes, the issue still exists with the latest master build:
Revision: r598175e (March 22 2019, 18:25:00)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=77647
--
Edit this bug report at https://bugs.php.net/bug.php?id=77647&edit=1