Skip to content

Windows Apache access violation using extension INTL #16900

Closed as not planned
Closed as not planned

Description

@guyphp1

Description

The following code:

Activity

  1. guyphp1 commented on Nov 22, 2024

    @guyphp1
    Author

    The following code makes Windows Apache x64 crashed with access violation:

    $fmt = datefmt_create('fr_CA', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Toronto', IntlDateFormatter::GREGORIAN);

    I am running the latest PHP 8.4 x64
    The problem seems related to the new ICU DLL ver 75
    If I replace these DLL with the ones on GITHUB, the problem is fixed
    Downloaded from:
    https://github.com/unicode-org/icu/releases/tag/release-75-1

  2. guyphp1 commented on Nov 22, 2024

    @guyphp1
    Author

    Error message:
    Nom de l’application défaillante httpd.exe, version : 2.4.62.0, horodatage : 0x66d81b2d
    Nom du module défaillant : MSVCP140.dll, version : 14.34.31938.0, horodatage : 0xe7a4b09e
    Code d’exception : 0xc0000005
    Décalage d’erreur : 0x0000000000013028
    ID du processus défaillant : 0x0x18FC
    Heure de début de l’application défaillante : 0x0x1DB3B5263258BE4
    Chemin d’accès de l’application défaillante : C:\xampp\apache\bin\httpd.exe
    Chemin d’accès du module défaillant: C:\xampp\apache\bin\MSVCP140.dll

  3. self-assigned this
    on Nov 22, 2024
  4. cmb69 commented on Nov 22, 2024

    @cmb69
    Member

    Can you please provide a stack backtrace (see https://bugs.php.net/bugs-generating-backtrace-win32.php)?

  5. guyphp1 commented on Nov 22, 2024

    @guyphp1
    Author

    Here is the backtrace, Let me know if it is the right thing.

    Analysis Summary
     Error
    Description | Recommendation -- | -- In httpd.exe_241122_142719.dmp the assembly instruction at msvcp140!mtx_do_lock+9c in C:\xampp\apache\bin\msvcp140.dll from Microsoft Corporation has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread 44 | Please follow up with the vendor Microsoft Corporation for C:\xampp\apache\bin\msvcp140.dll
    Analysis Summary Error Description Recommendation In httpd.exe_241122_142719.dmp the assembly instruction at msvcp140!mtx_do_lock+9c in C:\xampp\apache\bin\msvcp140.dll from Microsoft Corporation has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread [44](https://github.com//issues/16900#B1C1Thread5136) Please follow up with the vendor Microsoft Corporation for C:\xampp\apache\bin\msvcp140.dll Notification Description Recommendation DebugDiag determined that this dump file (httpd.exe_241122_142719.dmp) is a crash dump and did not perform any hang analysis. To run both hang rules and crash rules on crash dumps, select the following option in the 'Preferences' tab of the 'Settings' page in DebugDiag.Analysis.exe:
    'For crash dumps, run hang rules and crash rules'
    

    Analysis Details
    CrashHangAnalysis
    Report for httpd.exe_241122_142719.dmp
    Type of Analysis Performed Crash Analysis
    Machine Name P3202-I3S
    Operating System Windows 10 - 22631
    Number Of Processors 4
    Process ID 8756
    Process Image C:\xampp\apache\bin\httpd.exe
    Command Line C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache
    System Up-Time 14:56:00
    Process Up-Time 00:03:11
    Processor Type X64
    Process Bitness 64-Bit
    Faulting Thread
    Entry point libhttpd!ap_run_generate_log_id+3b80
    Create time 22/nov./2024 14:24:09
    Time spent in user mode 0 Days 0:0:0.0
    Time spent in kernel mode 0 Days 0:0:0.0

    Arg 1	    Arg 2	    Arg 3	    Arg 4	  Source
    

    msvcp140!mtx_do_lock+9c [D:\a_work\1\s\src\vctools\crt\github\stl\src\mutex.cpp @ 100 + 7] 000000000000140 000000000000001 0007ff93cd94628 000000000000000 D:\a_work\1\s\src\vctools\crt\github\stl\src\mutex.cpp @ 100 + 7
    icuuc75!icu_75::UMutex::getMutex+35 000000000000000 000000000000000 000004a00000000 000000000000000
    icuuc75!icu_75::Locale::getDefault+1f 000000000000000 000000000000000 000000000000000 000000000000004
    icuuc75!icu_75::Locale::init+fb 00000000000001f 000004a29afd9c0 00002112fa14090 00002112fa14080
    icuuc75!icu_75::Locale::Locale+34 000004a29afd9c0 00002112fa77378 000000000000000 0007ff93bea9320
    php_intl!get_module+1a4ba 00002112fa14090 00002112f505620 00002112fa5c0e0 00000000000000a
    php_intl!get_module+1abb1 00002112fa14090 0007ff93cfa2516 00002112fa65000 000000000000008
    php8ts!gc_possible_root+135b 00002112fa14020 00002112fa14020 00002112f505620 000000000000140
    php8ts!execute_ex+8f 00002112fa14020 000000000000000 00002112f505620 0007ff951d53049
    php8ts!zend_execute+1b2 000000000000140 000000000000000 00002112f505620 000021100000000
    php8ts!zend_execute_script+227 000021100000008 000000000000000 00002112fa5c001 000000000000024
    php8ts!php_execute_script_ex+1dd 00002112f534cf0 000000000000000 00002112f534cf0 00002112f446c48
    php8apache2_4+3c29 000000000000003 00000000000000a 00002112f534cf0 00002112ceb5770
    libhttpd!ap_run_handler+35 000000000000000 00002112f534cf0 000000000000000 00002112f534cf0
    libhttpd!ap_invoke_handler+11d 00002112f534cf0 000000000000000 0000000004c4b40 000000000000000
    libhttpd!ap_internal_redirect_handler+29a 00002112f51ce60 000000000000000 000000000000000 000021100000001
    libhttpd!ap_process_request+f 00002112ceb50a0 00002112f51ce60 000000000000000 000000000000000
    libhttpd!ap_byterange_filter+14c7 000000000000000 000021100000000 000000000000000 000000000000000
    libhttpd!ap_run_process_connection+35 00002112f51cc50 00002112f51ce60 000000000000000 000000000000000
    libhttpd!ap_process_connection+31 00002112c2aa800 00000000000002b 000000000000000 00002112f5d4268
    libhttpd!ap_run_generate_log_id+3ebe 000000000000000 000000000000000 00002112f5d42e0 000000000000000
    kernel32!BaseThreadInitThunk+1d 000000000000000 000000000000000 000000000000000 000000000000000
    ntdll!RtlUserThreadStart+28 000000000000000 000000000000000 000000000000000 000000000000000

    CLR Information
    Exception Information
    MSVCP140!MTX_DO_LOCK+9CIn httpd.exe_241122_142719.dmp the assembly instruction at msvcp140!mtx_do_lock+9c in C:\xampp\apache\bin\msvcp140.dll from Microsoft Corporation has caused an access violation exception (0xC0000005) when trying to read from memory location 0x00000000 on thread 44

    Module Information
    Image Name: C:\xampp\apache\bin\msvcp140.dll Symbol Type: PDB
    Base address: 0x0000000300905a4d Time Stamp: Tue Feb 24 11:06:54 2093 Checksum: 0x0000000000000000 Comments:
    COM DLL: False Company Name: Microsoft Corporation
    ISAPIExtension: False File Description: Microsoft® C Runtime Library
    ISAPIFilter: False File Version: 14.34.31938.0
    Managed DLL: False Internal Name: msvcp140.dll
    VB DLL: False Legal Copyright: © Microsoft Corporation. All rights reserved.
    Loaded Image Name: msvcp140.dll Legal Trademarks:
    Mapped Image Name: Original filename: msvcp140.dll
    Module name: msvcp140 Private Build:
    Single Threaded: False Product Name: Microsoft® Visual Studio®
    Module Size: 568 KBytes Product Version: 14.34.31938.0
    Symbol File Name: c:\symbols\msvcp140.amd64.pdb\0753A17D158361AF59555FCC6FB65C031\msvcp140.amd64.pdb Special Build: &

    Analysis Rule Summary
    Rule Name Status Details
    CrashHangAnalysis - v (2.3.0.37) Completed

    Table of Contents
    CrashHangAnalysis
    Report for httpd.exe_241122_142719.dmp
    Faulting Thread

  6. cmb69 commented on Nov 22, 2024

    @cmb69
    Member

    Thanks for the backtrace!

    The problem is most likely that your C:\xampp\apache\bin\MSVCP140.dll is a bit old. It's 14.34, while our ICU builds used 14.41, whereas the builds from ICU used 14.38. Apparently, somewhere between 14.38 and 14.41 an incompatibility was introduced. To verify, I found an older msvcp140.dll (14.26), put that early in the search path, and got the same crash.

    I suggest you download the latest Microsoft Visual C++ redistributable (direct donwload link), and install it. Then rename the old C:\xampp\apache\bin\MSVCP140.dll (or delete it, but consider to keep a backup, just in case), and see whether everything is fine. If not, open a cmd.exe in C:\xampp\apache\bin, and run where msvcp140.dll to see which msvcp140.dll is used, and replace if necessary.

    And possibly you don't even need to install the latest Microsoft Visual C++ redistributable; you may already have a recent version installed. Maybe just rename C:\xampp\apache\bin\MSVCP140.dll, and see what happens.

    Anyhow, welcome to DLL hell!

  7. guyphp1 commented on Nov 22, 2024

    @guyphp1
    Author

    I had already installed the latest Microsoft Visual C++ redistributable.
    So I just deleted the C:\xampp\apache\bin\MSVCP140.dll et now it is working fine.
    It seems this old MSVCP140.dll was loaded first in the search path.
    I don't know why it is was there as the current Apache installation install does not include this dll.
    Most likely and old Apache or XAMPP install.
    I will do more extensive testing and, if it all goes well, I will close this problem.
    Thank you for your help

  8. guyphp1 commented on Nov 23, 2024

    @guyphp1
    Author

    The problem has been resolved.
    It was caused by an outdated MSVCP140.dll in the apache\bin directory.
    As the C++ redistribuables were already installed, I just deleted this DLL from the apache\bin directory.
    Again, thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions