php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70740 Opcache extension causes PHP process termination
Submitted: 2015-10-19 14:30 UTC Modified: 2019-05-19 04:22 UTC
Votes:6
Avg. Score:4.3 ± 0.7
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: maly at myq dot cz Assigned: cmb (profile)
Status: No Feedback Package: opcache
PHP Version: 5.6.15RC1 OS: Windows 10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-10-19 14:30 UTC] maly at myq dot cz
Description:
------------
Same description as a bug  #70652 (https://bugs.php.net/bug.php?id=70652).

The described behaviour appears in version 5.6.10 and also in snapshot rc76fd64

(http://windows.php.net/downloads/snaps/php-5.6/rc76fd64/php-5.6-nts-windows-vc11-x86-rc76fd64.zip)

EventLog contains errors of following type:

Faulting application name: php-cgi.exe, version: 5.6.16.0, time stamp: 0x56243f5d
Faulting module name: php_opcache.dll, version: 5.6.16.0, time stamp: 0x5578c3d4
Exception code: 0xc0000005
Fault offset: 0x0000233b
Faulting process id: 0x39f8
Faulting application start time: 0x01d10a785d868a02
Faulting application path: C:\sw\PHP\PHP\php-cgi.exe
Faulting module path: c:\sw\PHP\PHP\php_opcache.dll
Report Id: 6b992b1c-83af-4301-92ff-293ff8caff77
Faulting package full name: 
Faulting package-relative application ID: 




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-20 09:52 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2015-10-20 09:52 UTC] ab@php.net
Thanks for the report. This looks like something else however, especially as you don't mention the "base address". Could you please show the backtrace? This info can help on getting it https://bugs.php.net/bugs-generating-backtrace-win32.php

Thanks.
 [2015-10-22 13:42 UTC] maly at myq dot cz
-Status: Feedback +Status: Open
 [2015-10-22 13:42 UTC] maly at myq dot cz
I have tested revision: 395ef4efb72aab6a660612be4632794f00991d85

I have generated several dumps and all crashes occured at the same location, see the stack:

php_opcache.dll!accel_startup(_zend_extension * extension) Line 2562	C
php5.dll!zend_extension_startup(_zend_extension * extension) Line 154	C
php5.dll!zend_llist_apply_with_del(_zend_llist * l, int (void *) * func) Line 178	C
php5.dll!zend_startup_extensions(...) Line 175	C
php5.dll!php_module_startup(_sapi_module_struct * sf, _zend_module_entry * additional_modules, unsigned int num_additional_modules) Line 2239	C
php-cgi.exe!php_cgi_startup(_sapi_module_struct * sapi_module) Line 939	C
php-cgi.exe!main(int argc, char * * argv) Line 1915	C
[External Code]	

Thanks for your time.

Best regards,
Petr Maly
 [2015-10-23 12:45 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2015-10-23 12:45 UTC] ab@php.net
Thanks for the trace, Petr. Could you please check whether this (or later) snap fixes the issue? http://windows.php.net/downloads/snaps/php-5.6/r22af882/ .

Otherwise I'd need your ini settings and maybe some description how to reproduce this.

Thanks.
 [2015-10-25 16:18 UTC] maly at myq dot cz
-Status: Feedback +Status: Open
 [2015-10-25 16:18 UTC] maly at myq dot cz
I have tested the listed snapshot, and I have compiled my own relaese binaries from revision 36311ee4fd0ad33735ab0dc02f795b65888ca72d and must announce that the crashing still persists. The stack is same as in previous step:

php_opcache.dll!accel_startup(_zend_extension * extension) Line 2599	C
php5.dll!zend_extension_startup(_zend_extension * extension) Line 154	C
php5.dll!zend_llist_apply_with_del(_zend_llist * l, int (void *) * func) Line 178	C
php5.dll!zend_startup_extensions(...) Line 175	C
php5.dll!php_module_startup(_sapi_module_struct * sf, _zend_module_entry * additional_modules, unsigned int num_additional_modules) Line 2312	C
php-cgi.exe!php_cgi_startup(_sapi_module_struct * sapi_module) Line 942	C
php-cgi.exe!main(int argc, char * * argv) Line 1919	C
[External Code]	

Thanks for your time.

Best regards,
Petr Maly
 [2015-10-26 11:32 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2015-10-26 11:32 UTC] ab@php.net
Ok, thanks for checking. Please post your ini and instructions to reproduce.

Thanks.
 [2015-10-26 11:56 UTC] maly at myq dot cz
-Status: Feedback +Status: Open
 [2015-10-26 11:56 UTC] maly at myq dot cz
I have used default php ini configuration. The only diffs:
- Extension path was directed to the same directory as php.exe
- there was enabled only extension:
      zend_extension=php_opcache.dll
- opcache settings:
     [opcache]
     opcache.memory_consumption=128
     opcache.interned_strings_buffer=8
     opcache.max_accelerated_files=4000
     opcache.revalidate_freq=60
     opcache.fast_shutdown=1
     opcache.enable_cli=0

The PHP was executed via mod_fcgid in apache 2.2.29. Httpd.conf snippet:

   LoadModule fcgid_module modules/mod_fcgid.so
   AddHandler fcgid-script .php

   FcgidWrapper "\"C:/sw/MyQ/php/php/php-cgi.exe\"" .php
   

   AddType application/x-httpd-php .php
   FcgidMaxProcesses 20
   FcgidMaxRequestsPerProcess 490
   # PHP has max_execution_time=300, add 10 here to be sure 
   FcgidIOTimeout 310
   # PHP has 20M, add 1M here to be sure
   FcgidMaxRequestLen 22020096

   # Fix the opcache bug with tmp path
   FcgidInitialEnv TEMP "C:/WINDOWS/TEMP"
   FcgidInitialEnv TMP "C:/WINDOWS/TEMP

I executed many requests using utility ab:

   ab -n 1000 -6 http://127.0.0.1/test.php

Where the content of test.php was following:

   <?php
   $sec = 3;
   echo "waiting $sec s...";
   
   for($i=0; $i < $sec; ++$i) {
   	sleep(1);
   }
   
   echo "konec<br>";
   echo "cekalo se $sec sekund";

   phpinfo();

Note: The same behaviour appears even we use our internal php process manager. Our php process manager is simple tool which preloads php processes, it uses (our implementation of) fast cgi to communicate with php.
 [2015-11-04 23:18 UTC] maly at myq dot cz
The same problem also happens in PHP 7 (sha1: f188b05aaf0d4fe0dd9436f93649e705c28c3c7d)
 [2019-05-07 17:23 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-05-07 17:23 UTC] cmb@php.net
Are you still experiencing this issue 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 Jul 02 05:01:26 2020 UTC