php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81204 PHP 8 crashes with Access Violation on Apache restart
Submitted: 2021-06-27 14:22 UTC Modified: 2021-06-29 07:24 UTC
From: jeremy dot dunn at dhamma dot org Assigned:
Status: Duplicate Package: Apache2 related
PHP Version: 8.0.7 OS: Windows Server 2012 R2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jeremy dot dunn at dhamma dot org
New email:
PHP Version: OS:

 

 [2021-06-27 14:22 UTC] jeremy dot dunn at dhamma dot org
Description:
------------
Windows Server 2012 R2; Apache httpd 2.4.48 x64; PHP 8.0.7 TS x64

Apache installed as windows service
PHP 8 installed as Apache module:
  LoadModule php_module "C:\Program Files\PHP\php8apache2_4.dll"

restarting Apache using ApacheMonitor (clean restart) causes crash dump as follows:


Report for httpd.exe_210627_070208.dmp
=========================================

Type of Analysis Performed Crash Analysis 
Machine Name DHAMMAREGPROD2 
Operating System Windows Server 2012 R2 
Number Of Processors 4 
Process ID 8512 
Process Image C:\Program Files\Apache24\bin\httpd.exe 
Command Line "C:\Program Files\Apache24\bin\httpd.exe" -d "C:/Program Files/Apache24" 
System Up-Time 1 day(s) 01:47:30 
Process Up-Time 10:47:12 
Processor Type X64 
Process Bitness 64-Bit 


Faulting Thread
==================
Entry point   httpd!OPENSSL_Applink+2014 
Create time   6/26/2021 8:14:56 PM 
Time spent in user mode   0 Days 0:0:0.140 
Time spent in kernel mode   0 Days 0:0:0.125 


    Arg 1

    Arg 2

    Arg 3

    Arg 4

  Source

php8ts!realpath_cache_clean+4f [C:\php-snap-build\php80\vs16\x64\php-8.0.7-ts\Zend\zend_virtual_cwd.c @ 346 + f]     0000000`00000038     0000000`00000007     0000000`00000118     00000f9`2d4dfd30   C:\php-snap-build\php80\vs16\x64\php-8.0.7-ts\Zend\zend_virtual_cwd.c @ 346 + f 
php8ts!tsrm_shutdown+f1 [C:\php-snap-build\php80\vs16\x64\php-8.0.7-ts\TSRM\TSRM.c @ 192 + c]     00000f8`e40756b8     00000f8`e3f0fcd9     0000000`00000000     00000f8`e3f0fb70   C:\php-snap-build\php80\vs16\x64\php-8.0.7-ts\TSRM\TSRM.c @ 192 + c 
php8apache2_4!php_apache_server_shutdown+24 [C:\php-snap-build\php80\vs16\x64\php-8.0.7-ts\sapi\apache2handler\sapi_apache2.c @ 421]     00000f8`e40756b8     0000000`00000000     0000000`00000000     0000000`00000000   C:\php-snap-build\php80\vs16\x64\php-8.0.7-ts\sapi\apache2handler\sapi_apache2.c @ 421 
libapr_1!apr_pool_destroy+6e     00000f8`e4071c28     00000f8`e40a4478     00000f8`e4071d30     0000000`00000000    
libapr_1!apr_pool_destroy+4f     00000f8`e4071d30     00000f8`00000000     0000000`00000000     0000000`00000000    
httpd!OPENSSL_Applink+280     00000f8`e40756b8     0007ff8`2e678208     00000f8`e3f0fcd9     0000000`00000000    
httpd!OPENSSL_Applink+eec     0000000`00000000     0000000`00000000     0000000`00000000     0000000`00000000    
httpd!OPENSSL_Applink+1fa4     0007ff6`3e3d3014     0007ff6`3daff000     0000000`00000000     0000000`00000000    
kernel32!BaseThreadInitThunk+22     0007ff8`345813d0     0000000`00000000     0000000`00000000     0000000`00000000    
ntdll!RtlUserThreadStart+34     0000000`00000000     0000000`00000000     0000000`00000000     0000000`00000000    


CLR Information


Exception Information


PHP8TS!REALPATH_CACHE_CLEAN+4FIn httpd.exe_210627_070208.dmp the assembly instruction at php8ts!realpath_cache_clean+4f in C:\Program Files\php\php8ts.dll from The PHP Group has caused an access violation exception (0xC0000005) when trying to read from memory location 0xe4a3f000 on thread 0


Module Information 

Image Name: C:\Program Files\php\php8ts.dll   Symbol Type:  PDB 
Base address: 0x00000003`00905a4d   Time Stamp:  Tue Jun 1 16:20:14 2021  
Checksum: 0x00000000`00000000   Comments:   
COM DLL: False   Company Name:  The PHP Group 
ISAPIExtension: False   File Description:  PHP Script Interpreter 
ISAPIFilter: False   File Version:  8.0.7 
Managed DLL: False   Internal Name:  PHP Script Interpreter 
VB DLL: False   Legal Copyright:  Copyright © The PHP Group 
Loaded Image Name:  php8ts.dll   Legal Trademarks:  PHP 
Mapped Image Name:     Original filename:  php8ts.dll 
Module name:  php8ts   Private Build:   
Single Threaded:  False   Product Name:  PHP 
Module Size:  8.87 MBytes   Product Version:  8.0.7 
Symbol File Name:  c:\program files\php-debug\php8ts.pdb   Special Build:  & 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-28 14:10 UTC] jeremy dot dunn at dhamma dot org
CMB commented:
> See <https://bugs.php.net/bug.php?id=81172#1624097564>.

that ticket was closed as "not a bug" due to incorrect / leftover PATH variable

I just double-checked the PATH on the machine from which this issue arose, and it points to the CURRENT (8.0.7) version of PHP:

  C:\Program Files\php;
 [2021-06-28 14:14 UTC] jeremy dot dunn at dhamma dot org
sorry, more information on the previous comment:

"PHP" resolves to the location I expect, as per previous comment
  C:\Users\jeremy>where php
  C:\Program Files\php\php.exe

"PHP" is definitely the correct version:

  C:\Users\jeremy>php --version
  PHP 8.0.7 (cli) (built: Jun  2 2021 00:41:03) ( ZTS Visual C++ 2019
  Copyright (c) The PHP Group
  Zend Engine v4.0.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.7, Copyright (c), by Zend Technologies
 [2021-06-28 14:27 UTC] nikic@php.net
This looks like https://github.com/php/php-src/commit/99a208566adfa32bf3a759c8731755f5e2458fdd to me, which only made it into PHP 8.0.8.
 [2021-06-28 15:08 UTC] jeremy dot dunn at dhamma dot org
> This looks like https://github.com/php/php-src/commit/99a208566adfa32bf3a759c8731755f5e2458fdd to me, which only made it into PHP 8.0.8.

Additional information:  on a different (non-production) server, I was running Apache httpd 2.4.47 + PHP 8.0.6 (slightly older versions than reported in this ticket).  restarting apache in that configuration did NOT cause PHP to crash

I just upgraded that server from apache 2.4.47 to 2.4.48, leaving PHP 8.0.6

the new combination DOES cause PHP crash on apache restart.  So the problem appears to be caused (at least in part) by a change in apache/httpd

Then I upgraded the same machine to PHP 8.0.8RC1, and the problem is FIXED - PHP does not crash on restart.  This appears to confirm that this bug is the same as #81068, and that the fix cited by @nikic does fix the problem.

Thanks!
 [2021-06-29 07:24 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2021-06-29 07:24 UTC] nikic@php.net
Thanks for checking! Closing this as a duplicate of bug #81068 then.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC