Bug #81204 [Com]: PHP 8 crashes with Access Violation on Apache restart

From: Date: Mon, 28 Jun 2021 15:08:05 +0000
Subject: Bug #81204 [Com]: PHP 8 crashes with Access Violation on Apache restart
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234669@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81204&edit=1

 ID:                 81204
 Comment by:         jeremy dot dunn at dhamma dot org
 Reported by:        jeremy dot dunn at dhamma dot org
 Summary:            PHP 8 crashes with Access Violation on Apache
                     restart
 Status:             Open
 Type:               Bug
 Package:            Apache2 related
 Operating System:   Windows Server 2012 R2
 PHP Version:        8.0.7
 Block user comment: N
 Private report:     N

 New Comment:

> 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!


Previous Comments:
------------------------------------------------------------------------
[2021-06-28 14:27:38] 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 14:14:09] 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:10:39] 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 13:13:35] cmb@php.net

See <https://bugs.php.net/bug.php?id=81172#1624097564>.

------------------------------------------------------------------------
[2021-06-27 14:22:13] 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]    
000000000000038     000000000000007     000000000000118    
00000f92d4dfd30   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]    
00000f8e40756b8     00000f8e3f0fcd9     000000000000000    
00000f8e3f0fb70   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]    
00000f8e40756b8     000000000000000     000000000000000    
000000000000000  
C:\php-snap-build\php80\vs16\x64\php-8.0.7-ts\sapi\apache2handler\sapi_apache2.c @ 421 
libapr_1!apr_pool_destroy+6e     00000f8e4071c28     00000f8e40a4478    
00000f8e4071d30     000000000000000    
libapr_1!apr_pool_destroy+4f     00000f8e4071d30     00000f800000000    
000000000000000     000000000000000    
httpd!OPENSSL_Applink+280     00000f8e40756b8     0007ff82e678208    
00000f8e3f0fcd9     000000000000000    
httpd!OPENSSL_Applink+eec     000000000000000     000000000000000    
000000000000000     000000000000000    
httpd!OPENSSL_Applink+1fa4     0007ff63e3d3014     0007ff63daff000    
000000000000000     000000000000000    
kernel32!BaseThreadInitThunk+22     0007ff8345813d0     000000000000000    
000000000000000     000000000000000    
ntdll!RtlUserThreadStart+34     000000000000000     000000000000000    
000000000000000     000000000000000    


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:  & 




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81204&edit=1


Thread (7 messages)

« previous php.bugs (#234669) next »