php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69233 PHP-CGI.EXE and OPCache crash with error code 0xc0000005
Submitted: 2015-03-12 20:59 UTC Modified: 2019-05-19 04:22 UTC
Votes:12
Avg. Score:4.5 ± 0.6
Reproduced:11 of 11 (100.0%)
Same Version:5 (45.5%)
Same OS:8 (72.7%)
From: julientld at free dot fr Assigned: cmb (profile)
Status: No Feedback Package: opcache
PHP Version: 7.0.1 OS: Windows Server 2012
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: julientld at free dot fr
New email:
PHP Version: OS:

 

 [2015-03-12 20:59 UTC] julientld at free dot fr
Description:
------------
Hello,

Server:
Windows Server 2012
IIS 8.0
PHP x86 NTS VC11 5.6.7-snap r4d8db15
MySQL 5.6.21
WinCache 1.3.7.x

Since I have migrated my server to PHP 5.5 in 09/2013 then to 5.6 in 10/2014, I observe a crash of the php-cgi.exe process related to the php_opcache.dll extension. The Windows Event Viewer displays an error code 0xc0000005.

In fact, this error only occurs one time each month for a year and a half. When updates are installed from Windows Update after the Patch Tuesday, the server is rebooted automatically and it is at this moment that the error concerning OPCache occurs. I think there is a problem during the shutdown of active processes. Visibly, I do not have other OPCache errors the rest of the time.

I have catched a few full dump files for this crash and ericsten has exported for me (thanks to him) the two below backtraces.

Perhaps this bug is linked to #69067 ?

Hope this will help you to make a fix.

Bye

Julien



* Windows Event Viewer


Nom du journal :Application
Source :       Application Error
Date :         12/03/2015 03:24:30
ID de l’événement :1000
Catégorie de la tâche :(100)
Niveau :       Erreur
Mots clés :    Classique
Utilisateur :  N/A
Ordinateur :   SRV1
Description :
Nom de l’application défaillante php-cgi.exe, version : 5.6.7.0, horodatage : 0x54da8130
Nom du module défaillant : php_opcache.dll, version : 5.6.7.0, horodatage : 0x54da8167
Code d’exception : 0xc0000005
Décalage d’erreur : 0x00004fd4
ID du processus défaillant : 0xa94
Heure de début de l’application défaillante : 0x01d05c6b9ec857da
Chemin d’accès de l’application défaillante : C:\php\php-cgi.exe
Chemin d’accès du module défaillant: C:\php\ext\php_opcache.dll
ID de rapport : e90ef187-c85e-11e4-9411-90b11c2fa6ed
Nom complet du package défaillant : 
ID de l’application relative au package défaillant :



* PHP backtraces


[php-cgi.exe.2876.dmp, php-cgi.exe.2708.dmp, php-cgi.exe.2776.dmp, php-cgi.exe.2900.dmp]
0:000> .ecxr
eax=018dca40 ebx=00000001 ecx=74bd6580 edx=00000064 esi=00ff8e20 edi=743df07c
eip=743c4fd4 esp=017ff2d4 ebp=74bd5000 iopl=0         nv up ei pl nz na po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010202
php_opcache!accel_startup+0x1d4:
743c4fd4 8b4064          mov     eax,dword ptr [eax+64h] ds:002b:018dcaa4=????????
0:000> k
  *** Stack trace for last set context - .thread/.cxr resets it
 # ChildEBP RetAddr  
00 017ff2e8 7469142f php_opcache!accel_startup+0x1d4 [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\ext\opcache\zendaccelerator.c @ 2594]
01 017ff2f4 746aac0a php5!zend_extension_startup+0xf [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\zend\zend_extensions.c @ 154]
02 017ff30c 7469110f php5!zend_llist_apply_with_del+0x1a [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\zend\zend_llist.c @ 178]
03 017ff3b0 77781b89 php5!zend_startup_extensions+0xf [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\zend\zend_extensions.c @ 175]
04 017ff434 77781b47 ntdll!RtlpHeapFindListLookupEntry+0x2a [d:\win8_gdr\minkernel\ntos\rtl\heapidx.c @ 608]
05 017ff45c 00eedb18 ntdll!RtlpFindEntry+0x49 [d:\win8_gdr\minkernel\ntos\rtl\heapidx.c @ 82]
WARNING: Frame IP not in any known module. Following frames may be wrong.
06 017ff490 7778575f 0xeedb18

0:000> .frame 0
00 017ff2e8 7469142f php_opcache!accel_startup+0x1d4 [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\ext\opcache\zendaccelerator.c @ 2594]
0:000> dv
      extension = 0x00f2ca40
           func = 0x00f81510
      ini_entry = 0x74694837
0:000> dt extension
Local var @ 0x17ff2f0 Type _zend_extension*
0x00f2ca40 
   +0x000 name             : 0x743db428  "Zend OPcache"
   +0x004 version          : 0x743db3b4  "7.0.4-dev"
   +0x008 author           : 0x743db3c0  "Zend Technologies"
   +0x00c URL              : 0x743db3d4  "http://www.zend.com/"
   +0x010 copyright        : 0x743db3ec  "Copyright (c) 1999-2015"
   +0x014 startup          : 0x743c4e00     int  php_opcache!accel_startup+0
   +0x018 shutdown         : (null) 
   +0x01c activate         : 0x743c4260     void  php_opcache!accel_activate+0
   +0x020 deactivate       : 0x743c4990     void  php_opcache!accel_deactivate+0
   +0x024 message_handler  : (null) 
   +0x028 op_array_handler : (null) 
   +0x02c statement_handler : (null) 
   +0x030 fcall_begin_handler : (null) 
   +0x034 fcall_end_handler : (null) 
   +0x038 op_array_ctor    : (null) 
   +0x03c op_array_dtor    : (null) 
   +0x040 api_no_check     : (null) 
   +0x044 build_id_check   : (null) 
   +0x048 reserved3        : (null) 
   +0x04c reserved4        : (null) 
   +0x050 reserved5        : (null) 
   +0x054 reserved6        : (null) 
   +0x058 reserved7        : (null) 
   +0x05c reserved8        : (null) 
   +0x060 handle           : 0x743c0000 HINSTANCE__
   +0x064 resource_number  : 0n-1
0:000> dt func
Local var @ 0x17ff2e4 Type _zend_function*
0x00f81510 
   +0x000 type             : 0x16 ''
   +0x000 common           : <unnamed-tag>
   +0x000 op_array         : _zend_op_array
   +0x000 internal_function : _zend_internal_function
0:000> dt ini_entry
Local var @ 0x17ff2e8 Type _zend_ini_entry*
0x74694837 
   +0x000 module_number    : 0n-2096079221
   +0x004 modifiable       : 0n1149830340
   +0x008 name             : 0x01a81424  ""
   +0x00c name_length      : 0xb3840f
   +0x010 on_modify        : 0x0d8b0000     int  +d8b0000
   +0x014 mh_arg1          : 0x74bd680c Void
   +0x018 mh_arg2          : 0x0274c985 Void
   +0x01c mh_arg3          : 0x4e8bd1ff Void
   +0x020 value            : 0x18468b1c  "--- memory read error at address 0x18468b1c ---"
   +0x024 value_length     : 0x574c985
   +0x028 orig_value       : 0xeb184189  "--- memory read error at address 0xeb184189 ---"
   +0x02c orig_value_length : 0x4578b0b
   +0x030 orig_modifiable  : 0n1334515235
   +0x034 modified         : 0n-1861973732
   +0x038 displayer        : 0x85184e8b     void  +ffffffff85184e8b

[php-cgi.exe.2684.dmp, php-cgi.exe.2860.dmp]
0:000> .ecxr
eax=0222d10f ebx=743db4c0 ecx=0222d113 edx=018dca40 esi=0002b5a5 edi=0222d0eb
eip=743c240e esp=00d8f63c ebp=00000001 iopl=0         nv up ei pl nz ac po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010212
php_opcache!accel_new_interned_string+0x20e:
743c240e 894a68          mov     dword ptr [edx+68h],ecx ds:002b:018dcaa8=0222d0eb
0:000> kn
  *** Stack trace for last set context - .thread/.cxr resets it
 # ChildEBP RetAddr  
00 00d8f658 743c2ac0 php_opcache!accel_new_interned_string+0x20e [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\ext\opcache\zendaccelerator.c @ 354]
01 00d8f670 743c5016 php_opcache!accel_use_shm_interned_strings+0x10 [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\ext\opcache\zendaccelerator.c @ 397]
02 00d8f68c 7469142f php_opcache!accel_startup+0x216 [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\ext\opcache\zendaccelerator.c @ 2604]
03 00d8f698 746aac0a php5!zend_extension_startup+0xf [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\zend\zend_extensions.c @ 154]
04 00d8f6b0 7469110f php5!zend_llist_apply_with_del+0x1a [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\zend\zend_llist.c @ 178]
05 00d8f754 77781b89 php5!zend_startup_extensions+0xf [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\zend\zend_extensions.c @ 175]
06 00d8f7d8 77781b47 ntdll!RtlpHeapFindListLookupEntry+0x2a [d:\win8_gdr\minkernel\ntos\rtl\heapidx.c @ 608]
07 00d8f800 0144db18 ntdll!RtlpFindEntry+0x49 [d:\win8_gdr\minkernel\ntos\rtl\heapidx.c @ 82]
WARNING: Frame IP not in any known module. Following frames may be wrong.
08 00d8f834 7778575f 0x144db18
0:000> dv
          arKey = <Memory access error>
     nKeyLength = <Memory access error>
       free_src = <Memory access error>
0:000> .frame 1
01 00d8f670 743c5016 php_opcache!accel_use_shm_interned_strings+0x10 [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\ext\opcache\zendaccelerator.c @ 397]
0:000> dv
0:000> .frame 2
02 00d8f68c 7469142f php_opcache!accel_startup+0x216 [c:\php-sdk\snap_5_6\vc11\x86\nts-windows-vc11-x86\ext\opcache\zendaccelerator.c @ 2604]
0:000> dv
      Unable to load c:\debuggersx86\Visualizers\Windows.Devices.Geolocation.natvis. Skipping...
extension = 0x0148ca40
           func = 0x014e16d0
      ini_entry = 0x74694837
0:000> dt extension
Local var @ 0xd8f694 Type _zend_extension*
0x0148ca40 
   +0x000 name             : 0x743db428  "Zend OPcache"
   +0x004 version          : 0x743db3b4  "7.0.4-dev"
   +0x008 author           : 0x743db3c0  "Zend Technologies"
   +0x00c URL              : 0x743db3d4  "http://www.zend.com/"
   +0x010 copyright        : 0x743db3ec  "Copyright (c) 1999-2015"
   +0x014 startup          : 0x743c4e00     int  php_opcache!accel_startup+0
   +0x018 shutdown         : (null) 
   +0x01c activate         : 0x743c4260     void  php_opcache!accel_activate+0
   +0x020 deactivate       : 0x743c4990     void  php_opcache!accel_deactivate+0
   +0x024 message_handler  : (null) 
   +0x028 op_array_handler : (null) 
   +0x02c statement_handler : (null) 
   +0x030 fcall_begin_handler : (null) 
   +0x034 fcall_end_handler : (null) 
   +0x038 op_array_ctor    : (null) 
   +0x03c op_array_dtor    : (null) 
   +0x040 api_no_check     : (null) 
   +0x044 build_id_check   : (null) 
   +0x048 reserved3        : (null) 
   +0x04c reserved4        : (null) 
   +0x050 reserved5        : (null) 
   +0x054 reserved6        : (null) 
   +0x058 reserved7        : (null) 
   +0x05c reserved8        : (null) 
   +0x060 handle           : 0x743c0000 HINSTANCE__
   +0x064 resource_number  : 0n-1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-13 06:58 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2015-03-13 06:58 UTC] laruence@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2015-03-13 07:55 UTC] julientld at free dot fr
Hello,

Thank you for your fast answer.

Ufortunately, I can't provide you a script as I don't have any error in the php log file when this issue occurs.

When the server reboots and when the php-cgi.exe processes are "killed", there are potentially hundreds of php scripts which could be in progress. I can't believe, each month for a year and a half this is exactly the same script which is running when the server reboots.

I don't think this error is related to a script or a function in particular but this is rather a problem for managing brutal shutdowns of the processes.

The backtrace is not sufficient to investigate this problem ?

Thanks.

Julien
 [2015-03-22 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.
 [2015-03-22 09:36 UTC] julientld at free dot fr
Hello,

Before suspending this bug, perhaps someone could answer my last comment ? The bug is absolutely not solved. Strange practice to investigate a bug.

Has anybody from the OPCache team studied the supplied backtrace ? I don't see what additional feedback I can give you as explained.

Thanks.
 [2015-03-23 13:15 UTC] bwoebi@php.net
-Status: No Feedback +Status: Open
 [2015-03-24 16:51 UTC] deivid dot garcia dot garcia at gmail dot com
I reported something similar in another PHP issue:

https://bugs.php.net/bug.php?id=69067

Opcode cache is failing intermitently on windows systems.

There is a chance that these issues are not related to a specific script but to zend engine not properly managing things under tough conditions (at least in windows) such as forecefully shtudown processes or high memory pressure.
 [2015-03-24 17:01 UTC] julientld at free dot fr
Yes, I have seen your bug report #69067. I hope someone from the dev team will give us soon infos about that.
 [2015-05-13 16:55 UTC] quantuumsnot at gmail dot com
Same issue under Windows 7 x64 and php-5.6.8-Win32-VC11-x64

Disabling the whole extension dll solves it.

opcache.enable_cli=0 doesn't help
 [2015-05-13 16:58 UTC] quantuumsnot at gmail dot com
To add some clarity - php is the thread-safe version
 [2015-05-14 15:59 UTC] quantuumsnot at gmail dot com
The exact error:
Unhandled exception at 0x000007FEEDE981BC (php_opcache.dll) in php-cgi.exe: 0xC0000094: Integer division by zero.
 [2015-12-14 19:44 UTC] julientld at free dot fr
For me the OPCache crash when Windows reboots seems to be solved by PHP 7.0. FYI, I have set the opcache.file_cache option. Not tried without.

Need more time to affirm definitely that the bug is 100 % fixed.
 [2016-01-28 09:06 UTC] julientld at free dot fr
Hello,

In fact not, the OPcache errors in the Windows Event Viewer are not yet solved despite PHP 7. I have had the following two below errors on the 2016/01/16.

The server configuration :

Windows Server 2012
IIS 8.0
PHP 7.0.1 NTS VC14 x64 (now 7.0.2)
MySQL 5.6.21
WinCache 2.0.0.4

I have a dump file corresponding to these errors if you want finally to investigate this bug...







Nom de l’application défaillante php-cgi.exe, version : 7.0.1.0, horodatage : 0x5671dbae
Nom du module défaillant : php_opcache.dll, version : 7.0.1.0, horodatage : 0x5671e09f
Code d’exception : 0xc0000005
Décalage d’erreur : 0x0000000000008d7d
ID du processus défaillant : 0x12c0
Heure de début de l’application défaillante : 0x01d150a8b7d531b0
Chemin d’accès de l’application défaillante : C:\php\php-cgi.exe
Chemin d’accès du module défaillant: C:\php\ext\php_opcache.dll
ID de rapport : f59bf806-bc9b-11e5-941e-90b11c2fa6ed
Nom complet du package défaillant : 
ID de l’application relative au package défaillant : 



and



La description de l’ID d’événement 487 dans la source Zend OPcache est introuvable. Le composant qui a déclenché 

cet événement n’est pas installé sur l’ordinateur local ou l’installation est endommagée. Vous pouvez installer ou 

réparer le composant sur l’ordinateur local.

Si l’événement provient d’un autre ordinateur, les informations d’affichage doivent être enregistrées avec 

l’événement.

Les informations suivantes étaient incluses avec l’événement : 

Base address marks unusable memory region (fall-back to file cache)
Tentative d’accès à une adresse non valide.
 [2016-01-28 09:09 UTC] julientld at free dot fr
-PHP Version: 5.6.7RC1 +PHP Version: 7.0.1
 [2016-01-28 09:09 UTC] julientld at free dot fr
PHP 7.0.1 also concerned.
PHP Version updated in the bug details.
 [2016-11-26 23:14 UTC] ricardolpinto at gmail dot com
Same error on windows server 2012, several error during the day

Log Name:      Application
Source:        Application Error
Date:          24/11/2016 09:42:17
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      multcloud
Description:
Faulting application name: php-cgi.exe, version: 7.0.12.0, time stamp: 0x57ffc9c3
Faulting module name: php_opcache.dll, version: 7.0.12.0, time stamp: 0x57ffd1ce
Exception code: 0xc0000005
Fault offset: 0x0000000000006db9
Faulting process id: 0x3d10
Faulting application start time: 0x01d24647ce7c8cb6
Faulting application path: C:\MultServer\php7012\php-cgi.exe
Faulting module path: C:\MultServer\php7012\ext\php_opcache.dll
Report Id: 0c4a6d83-b23b-11e6-80fe-001c42a7f7cf
Faulting package full name: 
Faulting package-relative application ID: 
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2016-11-24T11:42:17.000000000Z" />
    <EventRecordID>141222</EventRecordID>
    <Channel>Application</Channel>
    <Computer>multcloud</Computer>
    <Security />
  </System>
  <EventData>
    <Data>php-cgi.exe</Data>
    <Data>7.0.12.0</Data>
    <Data>57ffc9c3</Data>
    <Data>php_opcache.dll</Data>
    <Data>7.0.12.0</Data>
    <Data>57ffd1ce</Data>
    <Data>c0000005</Data>
    <Data>0000000000006db9</Data>
    <Data>3d10</Data>
    <Data>01d24647ce7c8cb6</Data>
    <Data>C:\MultServer\php7012\php-cgi.exe</Data>
    <Data>C:\MultServer\php7012\ext\php_opcache.dll</Data>
    <Data>0c4a6d83-b23b-11e6-80fe-001c42a7f7cf</Data>
    <Data>
    </Data>
    <Data>
    </Data>
  </EventData>
</Event>
 [2017-01-19 11:02 UTC] phpbugs at e-milt dot net
Any update on this?  I've seen reports about this going back a few years already and this error is still happening event with the current 7.0.14 version. It's very unpredictable, sometimes it happens but not all of the time. I don't think it depends on the script being executed. It seems to happend during startup of the PHP process itself.

Faulting application name: php-cgi.exe, version: 7.0.14.0, time stamp: 0x58474bec
Faulting module name: ntdll.dll, version: 6.3.9600.18233, time stamp: 0x56bb4e1d
Exception code: 0xc0000005
Fault offset: 0x0006a10d
Faulting process id: 0x20bc
Faulting application start time: 0x01d2723fb6c85657
Faulting application path: C:\inetpub\cgi\PHP\7.0.x\php-cgi.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: f47e6b98-de32-11e6-80d8-001517dd5ffe
Faulting package full name: 
Faulting package-relative application ID: 

And in the PHP error log:

[19-Jan-2017 11:37:17 Europe/Amsterdam] PHP Fatal error:  PHP Startup: apc_shm_create: shmget(0, 33554432, 658) failed: No such file or directory. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has usually a default limit of 32MB per segment. in Unknown on line 0
[19-Jan-2017 11:37:17 Europe/Amsterdam] PHP Fatal error:  PHP Startup: apc_shm_attach: shmat failed: in Unknown on line 0
 [2017-04-17 00:23 UTC] phpdev at ehrhardt dot nl
@e-milt See https://github.com/krakjoe/apcu/issues/223 and try the new builds of php_apcu.dll at http://windows.php.net/downloads/pecl/snaps/apcu/5.1.9dev/
 [2019-05-07 17:58 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-05-07 17:58 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 Jun 04 11:01:24 2020 UTC