php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72451 Wordpress/ stream_get_wrappers causes crash
Submitted: 2016-06-20 00:37 UTC Modified: 2017-03-29 12:23 UTC
Votes:6
Avg. Score:4.3 ± 1.5
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:4 (80.0%)
From: oldbucsfan at hotmail dot com Assigned: ab (profile)
Status: Closed Package: Apache2 related
PHP Version: 7.0.7 OS: Windows Server 2012 R2
Private report: No CVE-ID: None
 [2016-06-20 00:37 UTC] oldbucsfan at hotmail dot com
Description:
------------
Running on wordpress and installing php_ssh2.dll leads to a problem when calling and returning stream_get_wrappers(). It seems to stall and gives a white screen for Wordpress. I tested it out with a simple php script unassociated with Wordpress and I have seen it stall out in the middle of the script. This error does not occure when php_ss2.dll is not installed. Used the 1.0 version of php_ssh2.dll x64 thread safe.


Test script:
---------------
	$wrappers = stream_get_wrappers();
print_r($wrappers);
	$wrappers_re = '(' . join('|', $wrappers) . ')';
print($wrappers_re);


Expected result:
----------------
Array ( [0] => php [1] => file [2] => glob [3] => data [4] => http [5] => ftp [6] => zip [7] => compress.zlib [8] => https [9] => ftps [10] => phar [11] => ssh2.shell [12] => ssh2.exec [13] => ssh2.tunnel [14] => ssh2.scp [15] => ssh2.sftp ) (php|file|glob|data|http|ftp|zip|compress.zlib|https|ftps|phar|ssh2.shell|ssh2.exec|ssh2.tunnel|ssh2.scp|ssh2.sftp)


Actual result:
--------------
Array (

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-20 02:25 UTC] oldbucsfan at hotmail dot com
-Package: ssh2 +Package: Streams related
 [2016-06-20 02:25 UTC] oldbucsfan at hotmail dot com
I updated as the bug occurs when php_ssh2.dll is not loaded. It stopped at https, so I think this means it has something to do with php 7 and a memory leak.

Actual Result:
Array ( [0] => php [1] => file [2] => glob [3] => data [4] => http [5] => ftp [6] => zip [7] => compress.zlib [8]

When it is working correctly:
Array ( [0] => php [1] => file [2] => glob [3] => data [4] => http [5] => ftp [6] => zip [7] => compress.zlib [8] => https [9] => ftps [10] => phar ) (php|file|glob|data|http|ftp|zip|compress.zlib|https|ftps|phar)


Error in Apache:
AH00428: Parent: child process 5220 exited with status 3221225477 -- Restarting.

Error in PHP log:
PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 8245937481558682050 bytes) in C:\Apache24\htdocs\wordpress\wp-includes\functions.php on line 4946
 [2016-06-20 02:58 UTC] laruence@php.net
-Package: Streams related +Package: ssh2
 [2016-06-21 07:36 UTC] laruence@php.net
-Assigned To: +Assigned To: ab
 [2016-06-21 07:36 UTC] laruence@php.net
I can not reproduce this on linux, maybe a windows issue?
 [2016-06-21 15:50 UTC] oldbucsfan at hotmail dot com
Using the test code only worked after the PHP bug showed up in the error log while running Wordpress. So, it is possible that the test code only causes the unexpected result on Windows and after a series of other steps that Wordpress does. It is worth noting that this behavior does NOT happen with php 5.6.22. It does happen with both 86 and 64 versions of php 7.0.7.

Running the test code after the error in the PHP log twice actually fixed the whitescreen in Wordpress. So it seems that running the test script can actually fix the issue, but only after it is run twice. Sorry it is so complicated!
 [2016-06-25 01:39 UTC] oldbucsfan at hotmail dot com
It continues in php 7.0.8. I don't understand why it is trying to allocate so much memory. This time, running the test script did not fix the white screen.

PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 4410271868328452703 bytes) in C:\Apache24\htdocs\wordpress\wp-includes\functions.php on line 4946

Actual results:
Array ( [0] => php [1] => file [2] => glob [3] => data [4] => http [5] => ftp [6] => zip [7] =>

Get one of these every few hours in the apache log:
[mpm_winnt:notice] [pid 7824:tid 568] AH00428: Parent: child process 5280 exited with status 3221225477 -- Restarting.

Apache also continuously increases the amount of memory it is using until it is restart with such an error.
 [2016-06-27 20:20 UTC] oldbucsfan at hotmail dot com
I posted this back trace in bug https://bugs.php.net/bug.php?id=72359 , but I think it actually is associated with this bug. The error is thrown in same function.

DetailID = 1
	Count:    1
	Exception #:  0XC0000005
	Stack:        
		php7ts!zif_stream_get_wrappers+0x64 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\ext\standard\streamsfuncs.c @ 589]
		php7ts!ZEND_DO_ICALL_SPEC_HANDLER+0x84 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 595]
		php7ts!execute_ex+0x44 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 417]
		php7ts!zend_call_function+0x37a0a1 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_execute_api.c @ 867]
		php7ts!zend_call_method+0x152 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_interfaces.c @ 105]
		php7ts!zend_std_read_dimension+0x237 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_object_handlers.c @ 760]
		php7ts!ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER+0x379a49 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 31328]
		php7ts!execute_ex+0x44 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 417]
		php7ts!zend_call_function+0x37a0a1 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_execute_api.c @ 867]
		php7ts!zend_call_method+0x152 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_interfaces.c @ 105]
		php7ts!zend_std_read_dimension+0x237 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_object_handlers.c @ 760]
		php7ts!ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER+0x379a49 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 31328]
		php7ts!execute_ex+0x44 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 417]
		php7ts!zend_call_function+0x37a0a1 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_execute_api.c @ 867]
		php7ts!zend_call_method+0x152 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_interfaces.c @ 105]
		php7ts!zend_std_read_dimension+0x237 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_object_handlers.c @ 760]
		php7ts!ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER+0x379a49 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 31328]
		php7ts!execute_ex+0x44 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 417]
		php7ts!zend_execute+0x1f7 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 459]
		php7ts!zend_execute_scripts+0x13e [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend.c @ 1428]
		php7ts!php_execute_script+0x4d9 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\main\main.c @ 2494]
		php7apache2_4!php_handler+0x59e [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\sapi\apache2handler\sapi_apache2.c @ 679]
		libhttpd!ap_run_handler+0x35
		libhttpd!ap_invoke_handler+0x110
		libhttpd!ap_internal_redirect_handler+0x29a
		libhttpd!ap_process_request+0x17
		libhttpd!ap_sys_privileges_handlers+0x394f
		libhttpd!ap_run_process_connection+0x35
		libhttpd!ap_regkey_value_set+0x2374
		KERNEL32!BaseThreadInitThunk+0x22
		ntdll!RtlUserThreadStart+0x34


DetailID = 2
	Count:    1
	Exception #:  0XC0000005
	Stack:        
		php7ts!zend_string_copy [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_string.h @ 166]
		php7ts!zif_stream_get_wrappers+0x64 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\ext\standard\streamsfuncs.c @ 589]
		php7ts!ZEND_DO_ICALL_SPEC_HANDLER+0x84 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 595]
		php7ts!execute_ex+0x44 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 417]
		php7ts!zend_call_function+0x37a0a1 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_execute_api.c @ 867]
		php7ts!zend_call_method+0x152 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_interfaces.c @ 105]
		php7ts!zend_std_read_dimension+0x237 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_object_handlers.c @ 760]
		php7ts!ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER+0x379a49 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 31328]
		php7ts!execute_ex+0x44 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 417]
		php7ts!zend_call_function+0x37a0a1 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_execute_api.c @ 867]
		php7ts!zend_call_method+0x152 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_interfaces.c @ 105]
		php7ts!zend_std_read_dimension+0x237 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_object_handlers.c @ 760]
		php7ts!ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER+0x379a49 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 31328]
		php7ts!execute_ex+0x44 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 417]
		php7ts!zend_call_function+0x37a0a1 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_execute_api.c @ 867]
		php7ts!zend_call_method+0x152 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_interfaces.c @ 105]
		php7ts!zend_std_read_dimension+0x237 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_object_handlers.c @ 760]
		php7ts!ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER+0x379a49 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 31328]
		php7ts!execute_ex+0x44 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 417]
		php7ts!zend_execute+0x1f7 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend_vm_execute.h @ 459]
		php7ts!zend_execute_scripts+0x13e [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\zend\zend.c @ 1428]
		php7ts!php_execute_script+0x4d9 [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\main\main.c @ 2494]
		php7apache2_4!php_handler+0x59e [c:\php-sdk\php70dev\vc14\x64\php-7.0.7-ts\sapi\apache2handler\sapi_apache2.c @ 679]
		libhttpd!ap_run_handler+0x35
		libhttpd!ap_invoke_handler+0x110
		libhttpd!ap_internal_redirect_handler+0x29a
		libhttpd!ap_process_request+0x17
		libhttpd!ap_sys_privileges_handlers+0x394f
		libhttpd!ap_run_process_connection+0x35
		libhttpd!ap_regkey_value_set+0x2374
		KERNEL32!BaseThreadInitThunk+0x22
		ntdll!RtlUserThreadStart+0x34





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

	|--------------------|
	| Count | Exception  |
	|--------------------|
	| 2     | 0XC0000005 |
	|--------------------|
 [2016-07-02 06:35 UTC] oldbucsfan at hotmail dot com
The code here is where it occurs:

//Start
	if ((url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash())) {
		array_init(return_value);
		ZEND_HASH_FOREACH_STR_KEY(url_stream_wrappers_hash, stream_protocol) {
			if (stream_protocol) {
				add_next_index_str(return_value, zend_string_copy(stream_protocol));
			}
} ZEND_HASH_FOREACH_END();
//End

I wonder if what is happening is that php_stream_get_url_stream_wrappers_hash is returning a bad hash (perhaps corrupted or something?). This then goes through a few different stream_protocol iterations. When it hits the bad stream protocol, ZEND_HASH_FOREACH_STR_KEY still thinks it is a string, making the if evaluate as true. Then when zend_string_copy tries to copy the string through the pointer, it accesses a bad memory location and causes the crash.

I don't claim to have any expertise in this, but it was just my thoughts based on a novice look at the code.
 [2016-07-03 18:42 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2016-07-03 18:42 UTC] ab@php.net
@oldbucsfan thanks for staying on this. I'm currently unable to reproduce any crash with the latest ext/ssh2 and php dev trees. It looks more likely there were an issue in the ssh2 ext. I've pushed a couple of fixes to some obvious 
issues on x64 there. Could you please check the current ext/ssh2 state?

Thanks.
 [2016-07-03 23:07 UTC] oldbucsfan at hotmail dot com
Thanks for that! Sorry if I have sent you on a wild goose chase.

I created a brand new install of Apache 2.4.20 and PHP 7.0.8 just to make sure this was the case. These installs never had the php_ssh2 ext loaded. They gave me the same error within an hour of starting it up. In other words, the issue has nothing to do with php_ssh2. It is in the streams. These are the extensions I have loaded:

extension=php_curl.dll
extension=php_gd2.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll

I think the issue is that the hash is getting corrupted. Apache seems like it has some major memory leaks. Right now, I am just leaving php_ssh2 unloaded as I am only using it for something under development.
 [2016-07-04 14:38 UTC] ab@php.net
I still have no crash, default wordpress install. It might be, that some WP module could cause it. Are there any non standard modules? Maybe you could try to deactivate them one by one, if any?

Thanks.
 [2016-07-05 04:53 UTC] oldbucsfan at hotmail dot com
Thanks! The error happens kind of randomly. It could definitely be a particular plugin. However, I get no errors in any of the logs referring to anything other than getstreamwrappers() which is part of the core. I decided to try taking out all php extensions and add them back. By doing this I found that the offending extension is php_mbstring.dll. When this is not loaded, I don't get the error. I can do without the extension, but still don't know why its presence enables the error. It should be noted that the error only occurs at rather random times when the websites are being used at a good rate. I will just keep this extension disabled. Perhaps it is a plugin conflict with php_mbstring.dll. Unless someone else can think of a reason why php_mbstring would impact getstreamwrappers()?
 [2016-07-08 13:47 UTC] oldbucsfan at hotmail dot com
-Status: Feedback +Status: Assigned
 [2016-07-08 13:47 UTC] oldbucsfan at hotmail dot com
So, the error didn't really go away. It just morphed into this instead:

Apache crashes and I get the following error in the apache log:
AH00428: Parent: child process 780 exited with status 3221226356 -- Restarting.

Backtrace:
***********************
*  EXCEPTION DETAILS  *
***********************

DetailID = 1
	Count:    2
	Exception #:  0XC0000008
	Stack:        
		ntdll!KiRaiseUserExceptionDispatcher+0x3a
		KERNELBASE!CloseHandle+0x1b
		libapr_1!apr_shm_size_get+0x27d
		libapr_1!apr_shm_destroy+0x12
		mod_socache_shmcb+0x161c
		mod_ssl!ssl_run_proxy_post_handshake+0x8d12
		mod_ssl!ssl_run_pre_handshake+0x3d97
		libapr_1!apr_pool_clear+0x6e
		httpd!OPENSSL_Applink+0xcef
		httpd!OPENSSL_Applink+0x1f98
		KERNEL32!BaseThreadInitThunk+0x22
		ntdll!RtlUserThreadStart+0x34

It will much more rarely, but still result in getstreamwrappers failing as described in this bug report. While the backtrace may imply no real relation to PHP, this error doesn't happen with PHP 5.6. If I enable php_mbstring, this error goes away and the other returns. So, it seems these are being caused by the same problem.
 [2016-07-11 09:37 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2016-07-11 09:37 UTC] ab@php.net
Which Apache and PHP builds do you use?

Thanks.
 [2016-07-11 12:33 UTC] pajoye@php.net
That one looks more like incompatible ssl dlls being used together.
 [2016-07-11 14:40 UTC] oldbucsfan at hotmail dot com
-Status: Feedback +Status: Assigned
 [2016-07-11 14:40 UTC] oldbucsfan at hotmail dot com
Apache 2.4.20 (Apache Lounge binaries x64 ts) and PHP 7.0.8 from php.net (x64 ts) now.

I checked the backtrace and all ssl files are being loaded from the Apache and PHP directories. So, if the dlls are incompatible, the builds would seem to be incompatible, unless I am missing something.

  C:\Apache2.4.20\modules\mod_ssl.so loaded at 0x62a60000
  C:\Apache2.4.20\bin\LIBEAY32.dll loaded at 0xe66e0000
  C:\Apache2.4.20\bin\SSLEAY32.dll loaded at 0xe6db0000
  c:\php7.0.8x64\ext\php_openssl.dll loaded at 0xd8480000

I did notice this though:
  Current Breakpoint List(BL)
  Thread exited. Exiting thread - System ID: 1948. Exit code - 0x00000000
[7/7/2016 9:46:52 PM]
  c:\php7.0.8x64\ext\php_mysqli.dll Unloaded from 0xd84a0000
  C:\php7.0.8x64\libsasl.dll Unloaded from 0xe5850000
  c:\php7.0.8x64\ext\php_ldap.dll Unloaded from 0xdb980000
  c:\php7.0.8x64\ext\php_gd2.dll Unloaded from 0xdb9c0000
  C:\Windows\system32\Normaliz.dll Unloaded from 0xed050000
  C:\php7.0.8x64\libssh2.dll Unloaded from 0xdbc30000
  c:\php7.0.8x64\ext\php_curl.dll Unloaded from 0xe5870000
  C:\Windows\system32\CRYPT32.dll Unloaded from 0xec8b0000
  C:\Windows\system32\MSASN1.dll Unloaded from 0xec790000
  c:\php7.0.8x64\ext\php_openssl.dll Unloaded from 0xd8480000
  Exception 0XC0000008 on thread 2420. DetailID = 1
[7/7/2016 9:46:54 PM]
  Second chance exception - 0XC0000008 caused by thread with System ID: 2420 DetailID = 1
[7/7/2016 9:47:13 PM]
  Thread exited. Exiting thread - System ID: 10192. Exit code - 0xffffffff
  Thread exited. Exiting thread - System ID: 4024. Exit code - 0xffffffff
  Thread exited. Exiting thread - System ID: 2456. Exit code - 0xffffffff
  Thread exited. Exiting thread - System ID: 4040. Exit code - 0xffffffff
  Process exited. Exit code - 0xffffffff
 [2016-07-15 08:15 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2016-07-15 08:15 UTC] ab@php.net
Is the Apache build vc14 as well?

Thanks.
 [2016-07-15 15:22 UTC] oldbucsfan at hotmail dot com
-Status: Feedback +Status: Assigned
 [2016-07-15 15:22 UTC] oldbucsfan at hotmail dot com
Yes, VC14. Thanks!
 [2016-08-05 13:47 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2016-08-05 13:47 UTC] ab@php.net
Could you please check the latest release candidate? The linked ticket was reported as fixed, which is very similar to this one.

Thanks.
 [2016-08-08 14:36 UTC] oldbucsfan at hotmail dot com
-Status: Feedback +Status: Assigned
 [2016-08-08 14:36 UTC] oldbucsfan at hotmail dot com
Tried PHP 7.0.10RC1 and am getting this:
child process exited with status 3221226356

Trying to get a backtrace.
 [2016-08-08 15:14 UTC] oldbucsfan at hotmail dot com
So, this appears to have fixed the original error, but has left the other one. So, the issue with mbstring is fixed, but still leaves me with the 3221226356 ssl error. I guess the ssl error was triggering the mbstring error for some reason. Now just to figure out the ssl error. Again, doesn't happen with php 5.6.

Backtrace for error:

[8/8/2016 9:32:12 AM]
  Process created. BaseModule - C:\Apache2.4.20\bin\httpd.exe. BaseThread - System ID: 9368
  C:\Windows\SYSTEM32\ntdll.dll loaded at 0xa5990000
  Thread created. New thread - System ID: 5076
  Thread created. New thread - System ID: 1676
  Thread created. New thread - System ID: 1428
  Thread created. New thread - System ID: 10092
  C:\Windows\system32\KERNEL32.DLL loaded at 0xa34b0000
  C:\Windows\system32\KERNELBASE.dll loaded at 0xa2f00000
  C:\Windows\System32\SYSFER.DLL loaded at 0x70e60000
  C:\Apache2.4.20\bin\libhttpd.dll loaded at 0x70de0000
  C:\Apache2.4.20\bin\libaprutil-1.dll loaded at 0x70d90000
  C:\Apache2.4.20\bin\libapr-1.dll loaded at 0x70d50000
  C:\Windows\SYSTEM32\VCRUNTIME140.dll loaded at 0x9eaa0000
  C:\Windows\SYSTEM32\api-ms-win-crt-runtime-l1-1-0.dll loaded at 0x9ea90000
  C:\Windows\SYSTEM32\api-ms-win-crt-stdio-l1-1-0.dll loaded at 0x9db60000
  C:\Windows\SYSTEM32\api-ms-win-crt-string-l1-1-0.dll loaded at 0x9db50000
  C:\Windows\SYSTEM32\api-ms-win-crt-math-l1-1-0.dll loaded at 0x9db40000
  C:\Windows\SYSTEM32\api-ms-win-crt-locale-l1-1-0.dll loaded at 0x9d9a0000
  C:\Windows\SYSTEM32\api-ms-win-crt-heap-l1-1-0.dll loaded at 0x9d990000
  C:\Apache2.4.20\bin\pcre.dll loaded at 0x9ca50000
  C:\Windows\system32\WS2_32.dll loaded at 0xa5630000
  C:\Windows\system32\ADVAPI32.dll loaded at 0xa5250000
  C:\Windows\SYSTEM32\api-ms-win-crt-convert-l1-1-0.dll loaded at 0x9d980000
  C:\Windows\SYSTEM32\api-ms-win-crt-utility-l1-1-0.dll loaded at 0x9d970000
  C:\Windows\SYSTEM32\api-ms-win-crt-environment-l1-1-0.dll loaded at 0x9d690000
  C:\Windows\SYSTEM32\api-ms-win-crt-time-l1-1-0.dll loaded at 0x9d370000
  C:\Apache2.4.20\bin\libapriconv-1.dll loaded at 0x70d40000
  C:\Windows\SYSTEM32\MSWSOCK.dll loaded at 0xa2300000
  C:\Windows\system32\RPCRT4.dll loaded at 0xa54f0000
  C:\Windows\system32\SHELL32.dll loaded at 0xa3d00000
  C:\Windows\SYSTEM32\api-ms-win-crt-conio-l1-1-0.dll loaded at 0x9d360000
  C:\Windows\SYSTEM32\ucrtbase.DLL loaded at 0x9d230000
  C:\Windows\system32\NSI.dll loaded at 0xa54e0000
  C:\Windows\system32\msvcrt.dll loaded at 0xa31c0000
  C:\Windows\SYSTEM32\sechost.dll loaded at 0xa37a0000
  C:\Windows\system32\SspiCli.dll loaded at 0xa2b90000
  C:\Windows\SYSTEM32\combase.dll loaded at 0xa3280000
  C:\Windows\system32\USER32.dll loaded at 0xa3950000
  C:\Windows\system32\SHLWAPI.dll loaded at 0xa57f0000
  C:\Windows\system32\GDI32.dll loaded at 0xa3800000
  C:\Windows\SYSTEM32\CRYPTBASE.DLL loaded at 0xa2990000
  C:\Windows\SYSTEM32\bcryptPrimitives.dll loaded at 0xa28c0000
  C:\Windows\SYSTEM32\shcore.dll loaded at 0xa1410000
  C:\Windows\SYSTEM32\CRYPTSP.dll loaded at 0xa2360000
  C:\Windows\system32\rsaenh.dll loaded at 0xa1fa0000
  C:\Windows\SYSTEM32\bcrypt.dll loaded at 0xa25b0000
  C:\Windows\SYSTEM32\DNSAPI.dll loaded at 0xa2100000
  C:\Windows\System32\rasadhlp.dll loaded at 0x9dff0000
  C:\Windows\SYSTEM32\IPHLPAPI.DLL loaded at 0x9f560000
  C:\Windows\SYSTEM32\WINNSI.DLL loaded at 0x9f530000
  C:\Windows\System32\fwpuclnt.dll loaded at 0x9eb60000
  C:\Windows\system32\napinsp.dll loaded at 0x9dfb0000
  C:\Windows\system32\NLAapi.dll loaded at 0xa0640000
  C:\Windows\System32\winrnr.dll loaded at 0x9dfd0000
  C:\Apache2.4.20\modules\mod_alias.so loaded at 0x70d30000
  C:\Apache2.4.20\modules\mod_auth_basic.so loaded at 0x70d20000
  C:\Apache2.4.20\modules\mod_authz_core.so loaded at 0x70d10000
  C:\Apache2.4.20\modules\mod_authz_host.so loaded at 0x70d00000
  C:\Apache2.4.20\modules\mod_autoindex.so loaded at 0x70cf0000
  C:\Apache2.4.20\modules\mod_deflate.so loaded at 0x70ce0000
  C:\Apache2.4.20\bin\zlib1.dll loaded at 0x70cc0000
  C:\Apache2.4.20\modules\mod_dir.so loaded at 0x70cb0000
  C:\Apache2.4.20\modules\mod_env.so loaded at 0x70ca0000
  C:\Apache2.4.20\modules\mod_expires.so loaded at 0x70c90000
  C:\Apache2.4.20\modules\mod_filter.so loaded at 0x70c80000
  C:\Apache2.4.20\modules\mod_headers.so loaded at 0x70c70000
  C:\Apache2.4.20\modules\mod_imagemap.so loaded at 0x70c60000
  C:\Apache2.4.20\modules\mod_include.so loaded at 0x70c40000
  C:\Apache2.4.20\modules\mod_info.so loaded at 0x70c30000
  C:\Apache2.4.20\modules\mod_isapi.so loaded at 0x70c20000
  C:\Apache2.4.20\modules\mod_ldap.so loaded at 0x70c00000
  C:\Windows\system32\WLDAP32.dll loaded at 0xa5480000
  C:\Apache2.4.20\modules\mod_log_config.so loaded at 0x70bf0000
  C:\Apache2.4.20\modules\mod_mime.so loaded at 0x70be0000
  C:\Apache2.4.20\modules\mod_mime_magic.so loaded at 0x70bd0000
  C:\Apache2.4.20\modules\mod_negotiation.so loaded at 0x70bc0000
  C:\Apache2.4.20\modules\mod_proxy.so loaded at 0x70ba0000
  C:\Apache2.4.20\modules\mod_proxy_http.so loaded at 0x70b90000
  C:\Apache2.4.20\modules\mod_rewrite.so loaded at 0x70b70000
  C:\Apache2.4.20\modules\mod_setenvif.so loaded at 0x70b60000
  C:\Apache2.4.20\modules\mod_socache_shmcb.so loaded at 0x70b50000
  C:\Apache2.4.20\modules\mod_ssl.so loaded at 0x70b10000
  C:\Apache2.4.20\bin\LIBEAY32.dll loaded at 0x9c840000
  C:\Apache2.4.20\bin\SSLEAY32.dll loaded at 0x9c7e0000
  C:\Windows\SYSTEM32\api-ms-win-crt-filesystem-l1-1-0.dll loaded at 0x9cf70000
  C:\Apache2.4.20\modules\mod_status.so loaded at 0x70b00000
  C:\Program Files\MySQL\MySQL Server 5.7\lib\libmysql.dll loaded at 0x9c240000
  C:\Windows\SYSTEM32\Secur32.dll loaded at 0x9e000000
  C:\php7.0.10RC\php7apache2_4.dll loaded at 0x9cf60000
  C:\php7.0.10RC\php7ts.dll loaded at 0x82be0000
  C:\Windows\system32\ole32.dll loaded at 0xa3020000
  C:\Windows\system32\PSAPI.DLL loaded at 0xa3270000
  C:\Apache2.4.20\bin\apr_ldap-1.dll loaded at 0x70af0000
  c:\php7.0.10RC\ext\php_curl.dll loaded at 0x9c1c0000
  C:\php7.0.10RC\libssh2.dll loaded at 0x9c170000
  C:\Windows\system32\Normaliz.dll loaded at 0xa3cb0000
  c:\php7.0.10RC\ext\php_gd2.dll loaded at 0x89100000
  c:\php7.0.10RC\ext\php_ldap.dll loaded at 0x9c130000
  C:\php7.0.10RC\libsasl.dll loaded at 0x9cf40000
  c:\php7.0.10RC\ext\php_mbstring.dll loaded at 0x88f90000
  c:\php7.0.10RC\ext\php_mysqli.dll loaded at 0x9c100000
  c:\php7.0.10RC\ext\php_openssl.dll loaded at 0x9c0e0000
  C:\Windows\system32\CRYPT32.dll loaded at 0xa2c10000
  C:\Windows\system32\MSASN1.dll loaded at 0xa2b70000
  Thread created. New thread - System ID: 9972
  Initializing control script
  Clearing any existing breakpoints
  
  Current Breakpoint List(BL)
  Thread exited. Exiting thread - System ID: 9972. Exit code - 0x00000000
[8/8/2016 9:33:41 AM]
  Thread created. New thread - System ID: 8560
[8/8/2016 9:34:48 AM]
  Thread exited. Exiting thread - System ID: 1428. Exit code - 0x00000000
[8/8/2016 9:35:11 AM]
  Thread created. New thread - System ID: 8400
[8/8/2016 9:36:18 AM]
  Thread exited. Exiting thread - System ID: 8560. Exit code - 0x00000000
[8/8/2016 9:43:01 AM]
  Thread created. New thread - System ID: 9540
  Thread exited. Exiting thread - System ID: 9540. Exit code - 0x00000000
[8/8/2016 9:52:14 AM]
  c:\php7.0.10RC\ext\php_mysqli.dll Unloaded from 0x9c100000
  c:\php7.0.10RC\ext\php_mbstring.dll Unloaded from 0x88f90000
  C:\php7.0.10RC\libsasl.dll Unloaded from 0x9cf40000
  c:\php7.0.10RC\ext\php_ldap.dll Unloaded from 0x9c130000
  c:\php7.0.10RC\ext\php_gd2.dll Unloaded from 0x89100000
  C:\Windows\system32\Normaliz.dll Unloaded from 0xa3cb0000
  C:\php7.0.10RC\libssh2.dll Unloaded from 0x9c170000
  c:\php7.0.10RC\ext\php_curl.dll Unloaded from 0x9c1c0000
  C:\Windows\system32\CRYPT32.dll Unloaded from 0xa2c10000
  C:\Windows\system32\MSASN1.dll Unloaded from 0xa2b70000
  c:\php7.0.10RC\ext\php_openssl.dll Unloaded from 0x9c0e0000
  Exception 0XC0000008 on thread 9368. DetailID = 1
  Second chance exception - 0XC0000008 caused by thread with System ID: 9368 DetailID = 1
  Thread exited. Exiting thread - System ID: 10092. Exit code - 0xffffffff
  Thread exited. Exiting thread - System ID: 1676. Exit code - 0xffffffff
  Thread exited. Exiting thread - System ID: 8400. Exit code - 0xffffffff
  Thread exited. Exiting thread - System ID: 5076. Exit code - 0xffffffff
  Process exited. Exit code - 0xffffffff

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

DetailID = 1
	Count:    2
	Exception #:  0XC0000008
	Stack:        
		ntdll!KiRaiseUserExceptionDispatcher+0x3a
		KERNELBASE!CloseHandle+0x1b
		libapr_1!apr_shm_size_get+0x27d
		libapr_1!apr_shm_destroy+0x12
		mod_socache_shmcb+0x161c
		mod_ssl!ssl_run_proxy_post_handshake+0x8d12
		mod_ssl!ssl_run_pre_handshake+0x3d97
		libapr_1!apr_pool_clear+0x6e
		httpd!OPENSSL_Applink+0xcef
		httpd!OPENSSL_Applink+0x1f98
		KERNEL32!BaseThreadInitThunk+0x22
		ntdll!RtlUserThreadStart+0x34





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

	|--------------------|
	| Count | Exception  |
	|--------------------|
	| 2     | 0XC0000008 |
	|--------------------|
 [2016-08-10 11:50 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2016-08-10 11:50 UTC] ab@php.net
Thanks for the further checks! Now I don't see any PHP issue in the information you've provided. Though from the paths, you use 2.4.20. You could try the latest Apache builds, but otherwise it looks like there's no PHP issue anymore.

Thanks.
 [2016-08-14 15:47 UTC] oldbucsfan at hotmail dot com
-Status: Feedback +Status: Assigned
 [2016-08-14 15:47 UTC] oldbucsfan at hotmail dot com
Tried latest Apache build with same error. Getting it over and over. Any ideas as to why it would only happen with php7 and not php5?

Thanks again for the help.
 [2016-08-19 05:47 UTC] oldbucsfan at hotmail dot com
I tried again with php7 and continued to get the error when hitting https. Used abs.exe to test it and almost always get the error within 3 tests of 1000 requests. Usually get it in the first few hundred when hitting a wordpress site over SSL. Get it when all plugins are disabled. Get it hitting a website not using wordpress at all. Tried it with all extensions disabled except mysqli (needed to load the website). In other words, I can't seem to use Apache 2.4 with SSL and PHP 7. Tried basically totally simplifying the config files to the simplest form. Tried totally replacing the installs. The only thing that solves the error is using PHP 5.
 [2016-12-17 15:33 UTC] boldini at softcodex dot ch
Hi, I'm having the same exact problem. Every 1 to 30 days (randomly) apache return a 500 error, only of wordpress site that use this portion of code 

$wrappers = stream_get_wrappers();
$wrappers_re = '(' . join('|', $wrappers) . ')';

contained in wp-includes/functions.php wp_is_stream() function line 4944

Other php site (not wp) run normally fine. When restarting apache wp sites return working ok.

I tried to debug before restarting apache in index.php of wp, and putting this code before wp calls and exit (so no wp code are executing).

$wrappers = stream_get_wrappers();
$wrappers_re = '(' . join('|', $wrappers) . ')';
1. print_r($wrappers);
2. print_r(count($wrappers));
3. print_r(strlen($wrappers[10]));
exit();

Output was (point 1 is truncated):
1. Array ( [0] => php [1] => file [2] => glob [3] => data [4] => http [5] => ftp [6] => zip [7] => compress.zlib [8] => compress.bzip2 [9] => https [10] => 
2. 12
3. sorry no exact output, but was someting like 12TB -> 12123123123123

the right output after apache restart is:
1. Array ( [0] => php [1] => file [2] => glob [3] => data [4] => http [5] => ftp [6] => zip [7] => compress.zlib [8] => compress.bzip2 [9] => https [10] => ftps [11] => phar )
2. 12
3. 4

I'm running Windows 2012 R2, apache VC14 2.4.20 win64 and php 7.0.12 ts x64 with opcache enabled for all sites
no php_ssh2 loaded.

I'm not 100% sure but as I remember the problem begin to occur after enabling opcache, I hope this help.
 [2017-01-11 15:10 UTC] oldbucsfan at hotmail dot com
Thanks! Glad to know I'm not crazy!
 [2017-01-11 15:27 UTC] oldbucsfan at hotmail dot com
Okay, so using abs.exe 1000s of times with the following code will cause the crash:

-------------------------------
Test script:
$wrappers = stream_get_wrappers();
print_r($wrappers);
$wrappers_re = '(' . join('|', $wrappers) . ')';
print($wrappers_re);

This seems to temporarily relieve the issue.
----------------------------
Fix:
$wrappers = stream_get_wrappers();
print_r($wrappers);
$wrappers_re = "(php|file|glob|data|http|ftp|zip|compress.zlib|https|ftps|phar|ssh2.shell|ssh2.exec|ssh2.tunnel|ssh2.scp|ssh2.sftp)";
print($wrappers_re);
 [2017-01-11 18:49 UTC] oldbucsfan at hotmail dot com
The fix only help stop errors in the Wordpress debug log. Apache is still crashing with the same error code at the same frequency.
 [2017-01-12 16:46 UTC] oldbucsfan at hotmail dot com
-Package: ssh2 +Package: Apache2 related
 [2017-01-12 16:46 UTC] oldbucsfan at hotmail dot com
Should be Apache2 related and not ssh2 related.
 [2017-01-12 16:52 UTC] oldbucsfan at hotmail dot com
Also tests show that this only happens with https connections. Tesing with abs.exe to the same test code causes the error. Testing with ab.exe to the same test code does not cause the error.  Apache has no problems loading an html page over https. Same test code running PHP 5 does not cause the error.

So, this seems to be some sort of conflict between Apache https extensions and PHP 7 (doesn't happen with PHP 5).
 [2017-01-12 17:21 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2017-01-12 17:21 UTC] ab@php.net
@oldbucsfan as now there seems to be more or less stable reproduce case, could you please post the backtrace for it? The last backtrace in your comment from 2016-07-08 13:47 UTC did show only issue with Apache SSL module, no PHP. An accompanying thing could be to check, whether OpenSSL in your PHP and Apache are from the same series. Also, as per @boldini, is that still with or without Opcache?

Thanks.
 [2017-01-12 19:33 UTC] oldbucsfan at hotmail dot com
-Status: Feedback +Status: Assigned
 [2017-01-12 19:33 UTC] oldbucsfan at hotmail dot com
Thanks ab. All Apache/PHP/etc are all using OpenSSL/1.0.2j. So they aren't different versions. I have made sure that the right dlls are being loaded, so it's not a missing or conflicting dll. I'll get another backtrace for you.

Apache 2.4.25 (x64 vc14 ApacheLounge binaries)
PHP 7.1.0 (x64 thread safe from php.net)

boldini, are you also running with https enabled in Apache? It sounds like your error is much less frequent, but I was getting hit over https a few times a second, so a server with less load may not have this error appear but sparingly. It may be something where you need to have all 4 of these to get the error.

1. Apache enabled and fairly often hit over https
2. PHP 7
3. Windows Server 2012? - may or may not be a requirement
4. Some sort of code that triggers the error like the stream_get_wrappers(), although this may be more of a symptom than the source of the problem.
 [2017-01-31 15:47 UTC] boldini at softcodex dot ch
hi, I tried to run also ab and abs with -n 1000 -c 10 with the code

$wrappers = stream_get_wrappers();
print_r($wrappers);
$wrappers_re = '(' . join('|', $wrappers) . ')';
print($wrappers_re);

but no crash happens!
I can say my cash happen every 2/3 weeks

Only have 1 site with phpmyadmin that use https, so few connections per day..
All other are normal http
 [2017-02-27 15:19 UTC] stumpe at gmail dot com
Hello,

i came across this error and can reproduce it. i compiled apache and php myself (on Linux hostname 3.12.62-60.64.8-default #1 SMP Tue Oct 18 12:21:38 UTC 2016 (42e0a66) x86_64 x86_64 x86_64 GNU/Linux) and saw this error pop up in the wordpress-instance

PHP Fatal error:  Allowed memory size of 6442450944 bytes exhausted (tried to allocate 15126708878888855354 bytes) in wp-includes/functions.php on line 5161

which is this function:

function wp_is_stream( $path ) {
        $wrappers = stream_get_wrappers();
        $wrappers_re = '(' . join('|', $wrappers) . ')';

        return preg_match( "!^$wrappers_re://!", $path ) === 1;
}


so i tried this code - to take a look if this is a wordpress-problem

<?php
print_r(stream_get_wrappers());
?>

first time i called the URL for this code i got error 500 and another PHP Fatal Error in the log

apache let the corrupted child die

[Mon Feb 27 15:50:34.341436 2017] [core:notice] [pid 10599:tid 139796708411136] AH00052: child pid 5329 exit signal Segmentation fault (11)

second time calling the script i got the output:

Array ( [0] => https [1] => ftps [2] => compress.zlib [3] => php [4] => file [5] => glob [6] => data [7] => http [8] => ftp [9] => phar [10] => zip )

something is still weird

apache 2.4.25
php 7.1.2
openssl 1.0.2k
 [2017-03-08 17:47 UTC] ab@php.net
Please check the current master snapshots, a comprehensive patch fixing this kind of issues has landed there.

thanks.
 [2017-03-29 12:16 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2017-03-29 12:16 UTC] ab@php.net
Please try using this snapshot:

  http://snaps.php.net/php-trunk-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2017-03-29 12:23 UTC] ab@php.net
-Status: Feedback +Status: Closed
 [2017-03-29 12:23 UTC] ab@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Actually can be closed.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC