php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73983 crash on finish work with phar in cli + opcache
Submitted: 2017-01-24 09:07 UTC Modified: 2017-01-28 20:08 UTC
From: sailormax at inbox dot lv Assigned:
Status: Closed Package: opcache
PHP Version: 7.1.1 OS: Windows 10
Private report: No CVE-ID:
 [2017-01-24 09:07 UTC] sailormax at inbox dot lv
Description:
------------
sample files:
PHP: http://windows.php.net/downloads/releases/php-7.1.1-nts-Win32-VC14-x64.zip
PHAR: http://static.phpmd.org/php/2.6.0/phpmd.phar
test.php:
<?
	function foo($foo = 10)
	{
		$aa = 12;
	}
?>

php.ini:
extension_dir = ".\ext"
extension=php_bz2.dll
extension=php_mbstring.dll
;extension=php_v8js.dll
memory_limit = 4096M

display_errors = On
display_startup_errors = On
error_reporting = E_ALL
log_errors = On
error_log = "./"

zend_extension=php_opcache.dll
opcache.enable = 1
opcache.enable_cli = 1
opcache.huge_code_pages = 1
opcache.file_cache="c:\\Temp"
opcache.file_cache_only = 1
opcache.file_cache_consistency_checks = 1
opcache.file_cache_fallback = 1


Test script:
---------------
php -f phpmd.phar test.php text unusedcode

Expected result:
----------------
test.php:2        Avoid unused parameters such as '$foo'.
test.php:4        Avoid unused local variables such as '$aa'.


Actual result:
--------------
test.php:2        Avoid unused parameters such as '$foo'.
test.php:4        Avoid unused local variables such as '$aa'.
**crash**

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-24 12:31 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2017-01-24 12:31 UTC] ab@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2017-01-25 09:11 UTC] sailormax at inbox dot lv
-Status: Feedback +Status: Open
 [2017-01-25 09:11 UTC] sailormax at inbox dot lv
When I activate crash rule in Debug Diagnostic Tool - all work fine :)
Do you have another crash catcher?
 [2017-01-25 09:22 UTC] sailormax at inbox dot lv
Sorry, my fault with previous comment. I have crash, but now trying to use pdb-files. Analyser did not see it...
 [2017-01-25 09:38 UTC] sailormax at inbox dot lv
In Debug Diagnostic Tools 2.2.0.14 I can't find "Analyze data" button. Please update your documentation.
For analyze it has another tool: DebugDiag 2 Analysis, if I correct. But this tool did not see pdb files in my case :(

But I found text file of Debug Diagnostic Tools! And it, looks like, see required pdb files. Here its report:

[25-Jan-17 11:24:22]
  Process created. BaseModule - D:\max\programs\EditPlus\tools\validators\php\debug\php.exe. BaseThread - System ID: 6064
  C:\WINDOWS\SYSTEM32\ntdll.dll loaded at 0xe3ef0000
  Thread created. New thread - System ID: 10908
  Thread created. New thread - System ID: 7696
  Thread created. New thread - System ID: 8956
  C:\WINDOWS\System32\KERNEL32.DLL loaded at 0xe1f70000
  C:\WINDOWS\System32\KERNELBASE.dll loaded at 0xe08e0000
  C:\WINDOWS\System32\WS2_32.dll loaded at 0xe2880000
  D:\max\programs\EditPlus\tools\validators\php\debug\php7.dll loaded at 0xa60a0000
  C:\WINDOWS\System32\sechost.dll loaded at 0xe25b0000
  C:\WINDOWS\System32\RPCRT4.dll loaded at 0xe2020000
  C:\WINDOWS\System32\SHELL32.dll loaded at 0xe29e0000
  C:\WINDOWS\System32\msvcrt.dll loaded at 0xe1500000
  C:\WINDOWS\System32\cfgmgr32.dll loaded at 0xe0610000
  C:\WINDOWS\System32\windows.storage.dll loaded at 0xe0da0000
  C:\WINDOWS\System32\combase.dll loaded at 0xe22e0000
  C:\WINDOWS\System32\ucrtbase.dll loaded at 0xe0b00000
  C:\WINDOWS\System32\bcryptPrimitives.dll loaded at 0xe0c00000
  C:\WINDOWS\System32\powrprof.dll loaded at 0xe0380000
  C:\WINDOWS\System32\advapi32.dll loaded at 0xe2930000
  C:\WINDOWS\System32\shlwapi.dll loaded at 0xe2270000
  C:\WINDOWS\System32\GDI32.dll loaded at 0xe28f0000
  C:\WINDOWS\System32\gdi32full.dll loaded at 0xe0480000
  C:\WINDOWS\System32\USER32.dll loaded at 0xe2710000
  C:\WINDOWS\System32\win32u.dll loaded at 0xe0d80000
  C:\WINDOWS\System32\kernel.appcore.dll loaded at 0xe03d0000
  C:\WINDOWS\System32\shcore.dll loaded at 0xe0cd0000
  C:\WINDOWS\System32\profapi.dll loaded at 0xe0360000
  C:\WINDOWS\System32\ole32.dll loaded at 0xe1e30000
  C:\WINDOWS\System32\PSAPI.DLL loaded at 0xe1c20000
  C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll loaded at 0xd9bb0000
  C:\WINDOWS\SYSTEM32\DNSAPI.dll loaded at 0xdfa00000
  C:\WINDOWS\System32\NSI.dll loaded at 0xe22d0000
  C:\WINDOWS\System32\IMM32.DLL loaded at 0xe1bf0000
  C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL loaded at 0xdf9b0000
  D:\max\programs\EditPlus\tools\validators\php\debug\ext\php_opcache.dll loaded at 0xc2750000
  D:\max\programs\EditPlus\tools\validators\php\debug\ext\php_bz2.dll loaded at 0xd03a0000
  D:\max\programs\EditPlus\tools\validators\php\debug\ext\php_mbstring.dll loaded at 0xbf9c0000
  Thread created. New thread - System ID: 4016
  Initializing control script
  Clearing any existing breakpoints
  
  Current Breakpoint List(BL)
  Thread exited. Exiting thread - System ID: 4016. Exit code - 0x00000000
[25-Jan-17 11:24:23]
  D:\max\programs\EditPlus\tools\validators\php\debug\ext\php_mbstring.dll Unloaded from 0xbf9c0000
  D:\max\programs\EditPlus\tools\validators\php\debug\ext\php_bz2.dll Unloaded from 0xd03a0000
[25-Jan-17 11:24:24]
  Exception 0XC0000005 on thread 6064. DetailID = 1
[25-Jan-17 11:24:27]
  Second chance exception - 0XC0000005 caused by thread with System ID: 6064 DetailID = 1
  Thread exited. Exiting thread - System ID: 10908. Exit code - 0xffffffff
  Thread exited. Exiting thread - System ID: 7696. Exit code - 0xffffffff
  Thread exited. Exiting thread - System ID: 8956. Exit code - 0xffffffff
  Process exited. Exit code - 0xffffffff

***********************
*  EXCEPTION DETAILS  *
***********************

DetailID = 1
	Count:    2
	Exception #:  0XC0000005
	Stack:        
		php7!zend_hash_destroy+0xcf [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_hash.c @ 1249]
		php7!zm_globals_dtor_pcre+0x9 [c:\php-sdk\php71\vc14\x64\php-7.1.1\ext\pcre\php_pcre.c @ 138]
		php7!module_destructor+0xa3 [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_api.c @ 2510]
		php7!module_destructor_zval+0x11 [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend.c @ 633]
		php7!zend_hash_graceful_reverse_destroy+0x10b [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_hash.c @ 1473]
		php7!zend_shutdown+0x28 [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend.c @ 872]
		php7!php_module_shutdown+0x2b [c:\php-sdk\php71\vc14\x64\php-7.1.1\main\main.c @ 2408]
		php+0x1552
		php!php_cli_get_shell_callbacks+0x589
		KERNEL32!BaseThreadInitThunk+0x14
		ntdll!RtlUserThreadStart+0x21





***********************
*  EXCEPTION SUMMARY  *
***********************

	|--------------------|
	| Count | Exception  |
	|--------------------|
	| 2     | 0XC0000005 |
	|--------------------|

Debugging Overhead Cost:
	Total Elapsed Ticks = 6000 (100%)
	Total Ticks Spent in Debugger Engine = 3937 (66%)
	Total Ticks Spent in Crash Rule Script = 610 (10%)
 [2017-01-25 09:58 UTC] sailormax at inbox dot lv
DebugDiag Analysis did not support editing of directory with pdb files! Correctly support, but ignore new values :)
Here dump from Analysis:

php7!zend_hash_destroy+cf [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_hash.c @ 1249]   c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_hash.c @ 1249 
php7!zm_globals_dtor_pcre+9 [c:\php-sdk\php71\vc14\x64\php-7.1.1\ext\pcre\php_pcre.c @ 138]   c:\php-sdk\php71\vc14\x64\php-7.1.1\ext\pcre\php_pcre.c @ 138 
php7!module_destructor+a3 [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_api.c @ 2510 + 6]   c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_api.c @ 2510 + 6 
php7!module_destructor_zval+11 [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend.c @ 633]   c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend.c @ 633 
php7!zend_hash_graceful_reverse_destroy+10b [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_hash.c @ 1473]   c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend_hash.c @ 1473 
php7!zend_shutdown+28 [c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend.c @ 872]   c:\php-sdk\php71\vc14\x64\php-7.1.1\zend\zend.c @ 872 
php7!php_module_shutdown+2b [c:\php-sdk\php71\vc14\x64\php-7.1.1\main\main.c @ 2408]   c:\php-sdk\php71\vc14\x64\php-7.1.1\main\main.c @ 2408 
php!main+482 [c:\php-sdk\php71\vc14\x64\php-7.1.1\sapi\cli\php_cli.c @ 1398]   c:\php-sdk\php71\vc14\x64\php-7.1.1\sapi\cli\php_cli.c @ 1398 
php!__scrt_common_main_seh+11d [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 253 + 22]   f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl @ 253 + 22 
kernel32!BaseThreadInitThunk+14    
ntdll!RtlUserThreadStart+21
 [2017-01-28 20:08 UTC] ab@php.net
-Status: Open +Status: Verified
 [2017-01-30 11:48 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=368958b3e4ad341da02c901bfd58296d55d91605
Log: Fixed bug #73983 crash on finish work with phar in cli + opcache
 [2017-01-30 11:48 UTC] ab@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Fri Apr 28 14:01:35 2017 UTC