php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69067 Intermitent 0xc0000005 in php_opcache.dll
Submitted: 2015-02-17 15:28 UTC Modified: 2019-05-19 04:22 UTC
Votes:19
Avg. Score:4.7 ± 0.6
Reproduced:19 of 19 (100.0%)
Same Version:11 (57.9%)
Same OS:2 (10.5%)
From: deivid dot garcia dot garcia at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: opcache
PHP Version: 5.6.5 OS: Windows 8.1 x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: deivid dot garcia dot garcia at gmail dot com
New email:
PHP Version: OS:

 

 [2015-02-17 15:28 UTC] deivid dot garcia dot garcia at gmail dot com
Description:
------------
This was not happening prior to 5.6.5. Probably related to #68439.

I could not replicate the exact cause, but the error is happening too often.

I have caught full crash dump, downloadable from here:

https://www.dropbox.com/sh/0whrqzo7wswlp51/AABPJKFyqarQoQCm-oV1SoQ3a?dl=0

Faulting application name: php-cgi.exe, version: 5.6.5.0, time stamp: 0x54c04440
Faulting module name: php_opcache.dll, version: 5.6.5.0, time stamp: 0x54c04663
Exception code: 0xc0000005
Fault offset: 0x00006d4c
Faulting process id: 0x3398
Faulting application start time: 0x01d04abda2494faa
Faulting application path: C:\Program Files (x86)\PHP\php5.6\php-cgi.exe
Faulting module path: C:\Program Files (x86)\PHP\php5.6\ext\php_opcache.dll
Report Id: e0042eee-b6b0-11e4-8313-8019346bbdc6
Faulting package full name: 
Faulting package-relative application ID: 

Prior to the full crash, the event viewer gets full of these:

The description for Event ID 487 from source Zend OPcache cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

Unable to reattach to base address
Attempt to access invalid address.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-02 23:10 UTC] deivid dot garcia dot garcia at gmail dot com
I have received some helpful feedback about the issues from a PHP extension maintainer.

These are comments on three dumps, I can get ahold of all of them if needed.

php-cgi.exe.27180.dmp - No clue.  This appears to be an AV when handling a specific opcode, but I'm not sure what's wrong.  Since WinCache isn't the opcode cache, I'd suggest turning this over to the Zend Opcache folks.  Call Stack:
0:000> k
  *** Stack trace for last set context - .thread/.cxr resets it
# ChildEBP RetAddr 
WARNING: Frame IP not in any known module. Following frames may be wrong.
00 00dbe760 6d658622 0x0
01 00dbe770 6d373e0c php5!ZEND_USER_OPCODE_SPEC_HANDLER+0x12 [c:\php-sdk\php56\vc11\x86\php-5.6.6\zend\zend_vm_execute.h @ 1309]
02 00dbe7a8 6d342b2e php5!execute_ex+0x6c [c:\php-sdk\php56\vc11\x86\php-5.6.6\zend\zend_vm_execute.h @ 363]
03 00dbe7cc 6d342f9e php5!zend_execute+0x14e [c:\php-sdk\php56\vc11\x86\php-5.6.6\zend\zend_vm_execute.h @ 388]
04 00dbe800 6d342e6c php5!zend_execute_scripts+0xde [c:\php-sdk\php56\vc11\x86\php-5.6.6\zend\zend.c @ 1341]
05 00dbea94 77670cef php5!php_execute_script+0x14c [c:\php-sdk\php56\vc11\x86\php-5.6.6\main\main.c @ 2578]
06 (Inline) -------- ntdll!RtlpHeapZeroMemory+0x1d47b [d:\9142\minkernel\ntos\rtl\heappriv.h @ 3689]
07 00dbeb30 77651354 ntdll!RtlpLowFragHeapAllocFromContext+0x34d [d:\9142\minkernel\ntos\rtl\heaplowf.c @ 4516]
08 00dbebc4 7766443b ntdll!RtlAllocateHeap+0x14d [d:\9142\minkernel\ntos\rtl\heap.c @ 1872]
09 (Inline) -------- ntdll!RtlAppendUnicodeStringToString+0x2c [d:\9142\minkernel\ntos\rtl\nls.c @ 2231]
0a 00dbee64 7632a17d ntdll!RtlDosPathNameToRelativeNtPathName+0x1f6 [d:\9142\minkernel\ntdll\curdir.c @ 3343]
0b 00000000 00000000 KERNELBASE!FindFirstFileExW+0x231 [d:\9147\minkernel\kernelbase\filefind.c @ 995]
 
php-cgi.exe.35820.dmp - Failure during Zend Opcache startup.  Call Stack:
0:000> .ecxr
*** WARNING: Unable to verify checksum for php_opcache.dll
eax=8a014e8d ebx=00000000 ecx=6d392183 edx=139715e1 esi=f4bf0e93 edi=6d8004c9
eip=6eb96d4c esp=0118f71c ebp=0000000e iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210246
php_opcache!zend_accel_hash_find+0x10c:
6eb96d4c 8b1c90          mov     ebx,dword ptr [eax+edx*4] ds:002b:d85da611=????????
0:000> k
  *** Stack trace for last set context - .thread/.cxr resets it
# ChildEBP RetAddr 
00 0118f72c 6eb95122 php_opcache!zend_accel_hash_find+0x10c [c:\php-sdk\php56\vc11\x86\php-5.6.6\ext\opcache\zend_accelerator_hash.c @ 152]
01 0118f754 6d66985f php_opcache!accel_startup+0x322 [c:\php-sdk\php56\vc11\x86\php-5.6.6\ext\opcache\zendaccelerator.c @ 2647]
02 0118f760 6d6c672d php5!zend_extension_startup+0xf [c:\php-sdk\php56\vc11\x86\php-5.6.6\zend\zend_extensions.c @ 154]
03 0118f778 6d36a383 php5!zend_llist_apply_with_del+0x35e04d [c:\php-sdk\php56\vc11\x86\php-5.6.6\zend\zend_llist.c @ 178]
04 0118fa50 012d27e1 php5!php_module_startup+0x643 [c:\php-sdk\php56\vc11\x86\php-5.6.6\main\main.c @ 2305]
05 0118fa60 012d1202 php_cgi!php_cgi_startup+0x11 [c:\php-sdk\php56\vc11\x86\php-5.6.6\sapi\cgi\cgi_main.c @ 942]
06 0118fbf4 012d421c php_cgi!main+0x202 [c:\php-sdk\php56\vc11\x86\php-5.6.6\sapi\cgi\cgi_main.c @ 1918]
07 0118fc34 76f77c04 php_cgi!__tmainCRTStartup+0xfd [f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 536]
08 0118fc48 7766b5af kernel32!BaseThreadInitThunk+0x24 [d:\9147\base\win32\client\thread.c @ 78]
09 0118fc90 7766b57a ntdll!__RtlUserThreadStart+0x2f [d:\9142\minkernel\ntdll\rtlstrt.c @ 1029]
0a 0118fca0 00000000 ntdll!_RtlUserThreadStart+0x1b [d:\9142\minkernel\ntdll\rtlstrt.c @ 944]
 
php-cgi.exe.4468.dmp - Failure during Zend Opcache startup.  Call Stack:
0:000> k
  *** Stack trace for last set context - .thread/.cxr resets it
# ChildEBP RetAddr 
00 00a7f874 6eb95122 php_opcache!zend_accel_hash_find+0x10c [c:\php-sdk\php56\vc11\x86\php-5.6.6\ext\opcache\zend_accelerator_hash.c @ 152]
01 00a7f89c 6d66985f php_opcache!accel_startup+0x322 [c:\php-sdk\php56\vc11\x86\php-5.6.6\ext\opcache\zendaccelerator.c @ 2647]
02 00a7f8a8 6d6c672d php5!zend_extension_startup+0xf [c:\php-sdk\php56\vc11\x86\php-5.6.6\zend\zend_extensions.c @ 154]
03 00d0c5f8 6ebab3b4 php5!zend_llist_apply_with_del+0x35e04d [c:\php-sdk\php56\vc11\x86\php-5.6.6\zend\zend_llist.c @ 178]
04 00d0c5fc 6ebab3c0 php_opcache!`string'
05 00d0c600 6ebab3d4 php_opcache!`string'
06 00d0c604 6ebab3ec php_opcache!`string'
07 00d0c608 6eb94dff php_opcache!`string'
08 00d0c60c 00000000 php_opcache!accel_globals_dtor+0x1f
(stack starts off the same as php-cgi.exe.35820.dmp, but gets weird...it may be useful to someone.)
 [2015-04-16 00:08 UTC] michael dot litwak at nuix dot com
I get the same 0xc0000005 in php_opcache.dll error, but I am running the following:

- PHP 5.5.22 non-thread-safe x86 MSVC11
- Windows Server 2008 R2 Enterprise Edition with Service Pack 2
- IIS 75 with FastCGI enabled
- Zend OpCache enabled
- WinCache extension not loaded

The error appears 9 times in rapid succession in my server's Windows SYSTEM Event Log, during system startup.  a sample entry is shown below.  The errors cease after Microsoft Distributed Transaction Coordinator service starts, but that may be incidental.

The error has not repeated since startup, even though the web site is under moderate traffic running a PHP web application.

Log Name      Application
Source        Application Error
Date          4152015 61328 AM
Event ID      1000
Task Category (100)
Level         Error
Keywords      Classic
User          NA
Computer      MYSERVER
Description

Faulting application name: php-cgi.exe, version: 5.5.22.0, time stamp: 0x54e4dbb3
Faulting module name: php_opcache.dll, version: 5.5.22.0, time stamp: 0x54e4dd9d
Exception code: 0xc0000005
Fault offset: 0x0000235b
Faulting process id: 0xdd8
Faulting application start time: 0x01d07764cbafd42d
Faulting application path: C:\Program Files (x86)\PHP\v5.5\php-cgi.exe
Faulting module path: C:\Program Files (x86)\PHP\v5.5\ext\php_opcache.dll
Report Id: 0e93c307-e358-11e4-a6c4-001b78cbbe20
 [2015-04-16 00:27 UTC] michael dot litwak at nuix dot com
Corrections to previous comment:

The errors are logged in the Windows APPLICATION Event Log, not the SYSTEM event log.

The version of IIS is 7.5
 [2015-06-08 17:04 UTC] michael dot litwak at nuix dot com
Still happening under PHP 5.5.25, though only one time.

This time, I have WinCache 1.3.7.4 installed, but the WinCache OpCache is disabled (Zend OpCache is enabled and handing the OpCache).  

Here's the event log entry:

Faulting application name: php-cgi.exe, version: 5.5.25.0, time stamp: 0x55540fa2
Faulting module name: php_opcache.dll, version: 5.5.25.0, time stamp: 0x555411b6
Exception code: 0xc0000005
Fault offset: 0x00006d3c
Faulting process id: 0x17b8
Faulting application start time: 0x01d09968fa47c344
Faulting application path: C:\Program Files (x86)\PHP\v5.5\php-cgi.exe
Faulting module path: C:\Program Files (x86)\PHP\v5.5\ext\php_opcache.dll
Report Id: 38cceb5d-055c-11e5-a159-001b78cbbe20
 [2015-11-26 21:05 UTC] tser at deltacontrols dot com
Still experience the crash in 5.6.10

FAULTING_IP: 
php_opcache!zend_accel_hash_find+10c [c:\php-sdk\php56\vc11\x86\php-5.6.10\ext\opcache\zend_accelerator_hash.c @ 152]
6bc46cec 8b1c90          mov     ebx,dword ptr [eax+edx*4]

EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 6bc46cec (php_opcache!zend_accel_hash_find+0x0000010c)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: d85da611
Attempt to read from address d85da611

CONTEXT:  00000000 -- (.cxr 0x0;r)
eax=00000000 ebx=00000000 ecx=6bd71473 edx=139715e1 esi=00000003 edi=00000003
eip=7774ca2c esp=0138eb24 ebp=0138ecac iopl=0         nv up ei pl nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00200206
ntdll!NtWaitForMultipleObjects+0xc:
7774ca2c c21400          ret     14h

DEFAULT_BUCKET_ID:  INVALID_POINTER_READ

PROCESS_NAME:  php-cgi.exe

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  d85da611

READ_ADDRESS:  d85da611 

FOLLOWUP_IP: 
php_opcache!zend_accel_hash_find+10c [c:\php-sdk\php56\vc11\x86\php-5.6.10\ext\opcache\zend_accelerator_hash.c @ 152]
6bc46cec 8b1c90          mov     ebx,dword ptr [eax+edx*4]

NTGLOBALFLAG:  0

APPLICATION_VERIFIER_FLAGS:  0

APP:  php-cgi.exe

ANALYSIS_VERSION: 6.3.9600.17298 (debuggers(dbg).141024-1500) x86fre

FAULTING_THREAD:  00000760

PRIMARY_PROBLEM_CLASS:  INVALID_POINTER_READ

BUGCHECK_STR:  APPLICATION_FAULT_INVALID_POINTER_READ

LAST_CONTROL_TRANSFER:  from 6bc450c2 to 6bc46cec

STACK_TEXT:  
0138f660 6bc450c2 6bd71473 6c2682dc 0000000e php_opcache!zend_accel_hash_find+0x10c
0138f688 6c0654ff 01612a48 01612a40 6c0c271c php_opcache!accel_startup+0x322
0138f694 6c0c271c 01612a48 0138f748 00000002 php5!zend_extension_startup+0xf
01612a48 6bc5b3b4 6bc5b3c0 6bc5b3d4 6bc5b3ec php5!zend_llist_apply_with_del+0x354c9c
01612a4c 6bc5b3c0 6bc5b3d4 6bc5b3ec 6bc44da0 php_opcache!`string'
01612a50 6bc5b3d4 6bc5b3ec 6bc44da0 00000000 php_opcache!`string'
01612a54 6bc5b3ec 6bc44da0 00000000 6bc44200 php_opcache!`string'
01612a58 6bc44d9f 00000000 6bc44200 6bc44930 php_opcache!`string'
01612a5c 00000000 6bc44200 6bc44930 00000000 php_opcache!accel_globals_dtor+0x1f
 [2016-08-31 07:11 UTC] pandenitz at mail dot ru
Try this in php.ini:
opcache.mmap_base=0x20000000

It helps to resolve "The description for Event ID 487 from source Zend OPcache cannot be found" on Windows.
 [2019-05-07 17:33 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-05-07 17:33 UTC] cmb@php.net
Are you still experiencing these issues with any of the actively
supported[1] PHP versions?

If so, please try one of the snapshots[2] which include a possible
fix in a test environment (these are dev versions which are not
meant for production).

[1] <https://www.php.net/supported-versions.php>
[2] <https://windows.php.net/downloads/snaps/ostc/opcache-aslr/>
 [2019-05-19 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 29 14:01:44 2020 UTC