|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75886 opcache-xdebug crash on script restart
Submitted: 2018-01-29 16:35 UTC Modified: 2020-09-16 08:09 UTC
From: john-stevenson at blueyonder dot co dot uk Assigned: cmb (profile)
Status: Duplicate Package: Reproducible crash
PHP Version: Irrelevant OS: Windows 10
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.
Block user comment
Status: Assign to:
Bug Type:
From: john-stevenson at blueyonder dot co dot uk
New email:
PHP Version: OS:


 [2018-01-29 16:35 UTC] john-stevenson at blueyonder dot co dot uk
When a cli script (with opcache and xdebug loaded, and opcache.enable_cli=1) is restarted without xdebug, the restarted process crashes (but only on Windows).

First reported in Composer:
Fixed in user-land by setting opcache.enable_cli=0 for the new process
Reported to Xdebug:

Note that if the process is restarted WITH xdebug loaded there is no crash.

Test script:
Enable opcache and xdebug extensions. Set opcache.enable_cli=1

Run: php.exe comoser.phar --version

OR use this simple restart.php script:
Run: php.exe restart.php (crashes)
Run: php.exe restart.php --fix (okay)
Run: php.exe restart.php --keep-xdebug (okay)

Actual result:
From PHP-7.2.1

Unhandled exception at 0x00007FFF817C0D8F (ntdll.dll) in php.exe:
RangeChecks instrumentation code detected an out of range array access. occurred

ntdll.dll!LdrpICallHandler()	Unknown	Non-user code.
ntdll.dll!RtlpExecuteHandlerForException()	Unknown	Non-user code.
ntdll.dll!RtlDispatchException()	Unknown	Non-user code.
ntdll.dll!KiUserExceptionDispatch()	Unknown	Non-user code.
ntdll.dll!LdrpValidateUserCallTarget()	Unknown	Non-user code.
php7ts.dll!ZEND_USER_OPCODE_SPEC_HANDLER(_zend_execute_data * execute_data) Line 1813
php7ts.dll!execute_ex(_zend_execute_data * ex) Line 59726
php7ts.dll!zend_execute(_zend_op_array * op_array, _zval_struct * return_value) Line 63764
php7ts.dll!zend_execute_scripts(int type, _zval_struct * retval, int file_count, ...) Line 1497
php7ts.dll!php_execute_script(_zend_file_handle * primary_file) Line 2590
php.exe!do_cli(int argc, char * * argv) Line 1012
php.exe!main(int argc, char * * argv) Line 1404


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-07 13:35 UTC] john-stevenson at blueyonder dot co dot uk
This behavior can be more easily reproduced using opcache file-caching with a basic script:

echo "okay\n";


Config: opcache and xdebug extensions enabled

Run: php.exe test.php // Prints "okay"

Config: As above, but disable xdebug

Run: php.exe test.php // crashes
 [2018-02-07 21:27 UTC] john-stevenson at blueyonder dot co dot uk
This happens on *nix when opcache file-caching is being used. I have reported it here:
 [2018-02-08 01:11 UTC]
-Status: Open +Status: Verified
 [2018-02-08 01:11 UTC]
Yeah, this is known. Not a high priority to fix at this point. Disable opcache if you are using xdebug, for now.
 [2018-02-08 22:11 UTC] john-stevenson at blueyonder dot co dot uk
Thanks. Hopefully this should do the trick:
 [2020-09-16 08:09 UTC]
-Status: Verified +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2020-09-16 08:09 UTC]
Closing as duplicate of bug #79825, which recently has been fixed.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 11:01:34 2024 UTC