Skip to content

opcache random error with 8.4.0rc2 [Windows] #16449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nono303 opened this issue Oct 15, 2024 · 19 comments
Closed

opcache random error with 8.4.0rc2 [Windows] #16449

nono303 opened this issue Oct 15, 2024 · 19 comments

Comments

@nono303
Copy link
Contributor

nono303 commented Oct 15, 2024

Description

Hi!

I've noticed intermittent errors on 8.4.0rc2 (under windows) that I didn't have with 8.4.0rc1

My use case:

  • own build for Windows x64 NTS VS17
  • using php-cgi with httpd mod_fcgid
  • browsing on phpMyAdmin (all hit go to index.php router)
  • 🔴 having random 500 response status
! 500	 /phpmyadmin/index.php?route=/sql&pos=0&db=mydatabase&table=table1
200	 /phpmyadmin/index.php?route=%2Fmessages&l=fr&v=6.0.0-dev%2B20241009.5a82f71580
200	 /phpmyadmin/index.php?route=/navigation&ajax_request=1
200	 /phpmyadmin/index.php?route=/console/update-config
200	 /phpmyadmin/index.php?route=/database/structure/favorite-table&ajax_request=1&favorite_table=1&sync_favorite_tables=1
200	 /phpmyadmin/index.php?route=/version-check
200	 /phpmyadmin/index.php?route=/database/structure&db=mydatabase
! 500	 /phpmyadmin/index.php?route=/navigation&ajax_request=1
200	 /phpmyadmin/index.php?route=/console/update-config
! 500	 /phpmyadmin/index.php?route=/sql&pos=0&db=mydatabase&table=table2
200	 /phpmyadmin/index.php?route=/error-report
200	 /phpmyadmin/index.php?route=/navigation&ajax_request=1
200	 /phpmyadmin/index.php?route=/sql&pos=0&db=mydatabase&table=table2
200	 /phpmyadmin/index.php?route=/error-report
200	 /phpmyadmin/index.php?route=/sql&pos=0&db=mydatabase&table=table5
200	 /phpmyadmin/index.php?route=%2Fmessages&l=fr&v=6.0.0-dev%2B20241009.5a82f71580
200	 /phpmyadmin/index.php?route=/navigation&ajax_request=1
200	 /phpmyadmin/index.php?route=/console/update-config
200	 /phpmyadmin/index.php?route=/navigation&ajax_request=1
! 500	 /phpmyadmin/index.php?route=/sql&pos=0&db=mydatabase&table=table3
! 500	 /phpmyadmin/index.php?route=/sql&pos=0&db=mydatabase&table=table5
200	 /phpmyadmin/index.php?route=/sql&pos=0&db=mydatabase&table=table4
200	 /phpmyadmin/index.php?route=%2Fmessages&l=fr&v=6.0.0-dev%2B20241009.5a82f71580
200	 /phpmyadmin/index.php?route=/navigation&ajax_request=1
200	 /phpmyadmin/index.php?route=/console/update-config
200	 /phpmyadmin/index.php?route=/navigation&ajax_request=1
! 500	 /phpmyadmin/index.php?route=/sql&pos=0&db=mydatabase&table=table6
  • ❌ no log in php error.log
  • ❌ no error in opcache log opcache.log_verbosity_level=4
  • ❌ no entriy in Windows Event Log Viewer
  • just having mod_fcgid error in http log
2024-10-15 08:29:31.552563 mydomain 1.2.3.4:56396 Zw4Ly_ss--S531oNTzivwAAAALg fcgid:warn fcgid_proc_win.c(363) pid:26776 tid:3724 ka:58 [get overlap result error]
2024-10-15 08:29:31.552563 mydomain 1.2.3.4:56396 Zw4Ly_ss--S531oNTzivwAAAALg core:error util_script.c(503) pid:26776 tid:3724 ka:58 [End of script output before headers: index.php]

... FcgidErrorScanInterval:60 secondes

2024-10-15 08:30:32.431166 - - - fcgid:info fcgid_proc_win.c(504) pid:26776 tid:976 [mydomain:C:/serveur/php/php-cgi.exe(39904) exit(-1073741819) communication error]
2024-10-15 08:30:32.431166 - - - fcgid:info fcgid_proc_win.c(504) pid:26776 tid:976 [mydomain:C:/serveur/php/php-cgi.exe(19048) exit(-1073741819) communication error]
2024-10-15 08:30:32.431166 - - - fcgid:info fcgid_proc_win.c(504) pid:26776 tid:976 [mydomain:C:/serveur/php/php-cgi.exe(28860) exit(-1073741819) communication error]
2024-10-15 08:30:32.431166 - - - fcgid:info fcgid_proc_win.c(504) pid:26776 tid:976 [mydomain:C:/serveur/php/php-cgi.exe(17540) exit(1) connect error, server may has exited]

Disabling opcache on 8.4.0rc2: ✅ no random 500
Rolling back to 8.4.0rc1 with opcahce enabled: ✅ no random 500

available to detail or perform other tests as needed

PHP Version

PHP 8.4.0-rc2

Operating System

Windows 11 x64 vs17 NTS

@iluuu1994
Copy link
Member

Hi @nono303. There are many changes between RC1 and RC2. It would be helpful if you could extract a crash log.

https://bugs.php.net/bugs-generating-backtrace-win32.php

@nono303
Copy link
Contributor Author

nono303 commented Oct 15, 2024

I'm already in debug mode and no dmp file were produced

  1. configure
phpsdk-config_make for 8.4
configure --disable-cli-win32 --disable-debug --disable-embed --disable-ipv6 --disable-phpdbg --disable-phpdbgs --disable-security-flags --disable-test-ini --enable-debug-pack --enable-fd-setsize=2048 --enable-object-out-dir=../build/ --without-analyzer --without-enchant --without-snmp --without-ldap --without-pgsql --without-uncritical-warn-choke --with-toolset=vs --with-cygwin=C:\sdk\softs\cyg64\bin --with-extra-includes=C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include;C:\sdk\release\vs17_x64-avx2\include;C:\sdk\release\vs17_x64-avx2\_proj\include;C:\sdk\release\vs17_x64-avx2\_gdal\include --with-extra-libs=C:\sdk\release\vs17_x64-avx2\_openssl\openssl\lib;C:\sdk\release\vs17_x64-avx2\lib;C:\sdk\release\vs17_x64-avx2\_proj\lib;C:\sdk\release\vs17_x64-avx2\_gdal\lib --with-mp=16 --enable-mbstring=shared --enable-phar-native-ssl --enable-brotli=shared --enable-com-dotnet=shared --enable-exif=shared --enable-fileinfo=shared --enable-ftp=shared --enable-intl=shared --enable-opcache=shared --enable-pdo=shared --enable-soap=shared --enable-sockets=shared --with-bz2=shared --with-curl=shared --with-iconv=C:\sdk\release\vs17_x64-avx2 --with-mysqli=shared --with-openssl=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-sqlite3=shared --with-tidy=shared --with-xdiff=shared --with-geos=shared --with-sodium=shared --with-xml=shared --enable-xmlreader=shared --enable-xmlwriter=shared --with-simplexml=shared --with-dom=shared --with-iconv=shared --enable-zip=shared --enable-zlib=shared --with-readline=shared --enable-pdo=shared --enable-calendar=shared --enable-ctype=shared --enable-bcmath=shared --with-gd=shared --with-xsl=shared --with-gmp=shared --enable-zstd=shared --with-libxml=shared --with-proj=shared --with-ogr=shared --enable-memcache=shared --with-xdebug=shared --with-xdebug-compression --enable-timezonedb=shared --enable-sync=shared --disable-zts --enable-native-intrinsics=sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2 --enable-sanitizer --with-php-build=C:\sdk\release\vs17_x64-avx2 --with-openssl-argon2 
PHP Version: 8.4.0RC2
  1. result
C:\sdk\release\vs17_x64-avx2\_php-nts\php-cgi.exe
C:\sdk\release\vs17_x64-avx2\_php-nts\php-cgi.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php.exe
C:\sdk\release\vs17_x64-avx2\_php-nts\php.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php8.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php8.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_bcmath.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_bcmath.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_brotli.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_brotli.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_bz2.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_bz2.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_calendar.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_calendar.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_com_dotnet.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_com_dotnet.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_ctype.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_ctype.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_curl.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_curl.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_dom.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_dom.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_exif.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_exif.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_fileinfo.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_fileinfo.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_ftp.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_ftp.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_gd.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_gd.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_geos.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_geos.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_gmp.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_gmp.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_iconv.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_iconv.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_intl.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_intl.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_mbstring.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_mbstring.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_memcache.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_memcache.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_mysqli.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_mysqli.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_ogr.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_ogr.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_opcache.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_opcache.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_openssl.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_openssl.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_pdo_mysql.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_pdo_mysql.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_pdo_sqlite.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_pdo_sqlite.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_proj.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_proj.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_readline.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_readline.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_simplexml.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_simplexml.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_soap.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_soap.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_sockets.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_sockets.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_sodium.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_sodium.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_sqlite3.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_sqlite3.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_sync.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_sync.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_tidy.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_tidy.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_timezonedb.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_timezonedb.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xdebug.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xdebug.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xdiff.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xdiff.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xml.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xml.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xmlreader.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xmlreader.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xmlwriter.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xmlwriter.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xsl.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_xsl.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_zip.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_zip.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_zlib.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_zlib.pdb
C:\sdk\release\vs17_x64-avx2\_php-nts\php_zstd.dll
C:\sdk\release\vs17_x64-avx2\_php-nts\php_zstd.pdb
C:\sdk\release\vs17_x64-avx2\lib\php8.lib
  1. AeDebugger
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]
"UserDebuggerHotKey"=dword:00000000
"Auto"="1"
"Debugger"="\"C:\\Program Files\\wscc\\sysinternals\\procdump64.exe\" -accepteula -ma -j \"R:\\procdump\" %ld %ld %p"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\AutoExclusionList]
"DWM.exe"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\ProcDump]

@iluuu1994
Copy link
Member

I can't help with Windows, maybe @cmb69 can?

@cmb69
Copy link
Member

cmb69 commented Oct 15, 2024

mydomain:C:/serveur/php/php-cgi.exe(39904) exit(-1073741819) communication error

That is a segfault error code; I have no idea why you don't get a crash dump. Maybe register WinDbg as post mortem debugger. Or use VS 2022 to attach to the FCGI PHP processes.

Also, do the crashes happen only with OPcache JIT enabled? If so, which settings do you use (especially, opcache.jit and opcache.jit_buffer_size)?

@cmb69
Copy link
Member

cmb69 commented Oct 15, 2024

Oh, also try without Xdebug.

@nono303
Copy link
Contributor Author

nono303 commented Oct 15, 2024

Oh, also try without Xdebug.

Xdebug is not enabled

which settings do you use (especially, opcache.jit and opcache.jit_buffer_size)?

opcache.jit=tracing
opcache.jit_buffer_size=100M
my full opcache config running without problem since PHP 8.1...
Opcode Caching Up and Running
Optimization Enabled
SHM Cache Enabled
File Cache Disabled
JIT On
Startup OK
Shared memory model win32
Cache hits 275
Cache misses 20
Used memory 74200008
Free memory 2073283640
Wasted memory 0
Interned Strings Used memory 17347768
Interned Strings Free memory 49761096
Cached scripts 20
Cached keys 59
Max keys 130987
OOM restarts 0
Hash keys restarts 0
Manual restarts 0
Start time 2024-10-15T16:21:36+0200
Last restart time none
Last force restart time none
Directive Local Value
opcache.blacklist_filename no value
opcache.cache_id php8
opcache.dups_fix Off
opcache.enable On
opcache.enable_cli Off
opcache.enable_file_override On
opcache.error_log d:/php/logs/opcache.log
opcache.file_cache no value
opcache.file_cache_consistency_checks Off
opcache.file_cache_fallback Off
opcache.file_cache_only Off
opcache.file_update_protection 0
opcache.force_restart_timeout 180
opcache.interned_strings_buffer 64
opcache.jit tracing
opcache.jit_bisect_limit 0
opcache.jit_blacklist_root_trace 16
opcache.jit_blacklist_side_trace 8
opcache.jit_buffer_size 100M
opcache.jit_debug 0
opcache.jit_hot_func 127
opcache.jit_hot_loop 64
opcache.jit_hot_return 8
opcache.jit_hot_side_exit 8
opcache.jit_max_exit_counters 8192
opcache.jit_max_loop_unrolls 8
opcache.jit_max_polymorphic_calls 2
opcache.jit_max_recursive_calls 2
opcache.jit_max_recursive_returns 2
opcache.jit_max_root_traces 1024
opcache.jit_max_side_traces 128
opcache.jit_max_trace_length 1024
opcache.jit_prof_threshold 0.005
opcache.log_verbosity_level 2
opcache.max_accelerated_files 65535
opcache.max_file_size 0
opcache.max_wasted_percentage 10
opcache.memory_consumption 2048
opcache.mmap_base 0x0000700000000000
opcache.opt_debug_level 0
opcache.optimization_level 0x7FFEBFFF
opcache.preferred_memory_model no value
opcache.preload no value
opcache.protect_memory Off
opcache.record_warnings On
opcache.restrict_api no value
opcache.revalidate_freq 0
opcache.revalidate_path Off
opcache.save_comments Off
opcache.use_cwd On
opcache.validate_permission Off
opcache.validate_timestamps On

@cmb69
Copy link
Member

cmb69 commented Oct 16, 2024

Okay, can you please try running without OPcache JIT? If that doesn't error we know at least that the issue is JIT related.

Still, we need some crash dump/backtrace (although that might not really help, especially if JIT related).

@nono303
Copy link
Contributor Author

nono303 commented Oct 18, 2024

Hi @cmb69,

Okay, can you please try running without OPcache JIT?

Good catch! with opcache.jit=disable no more 500
Here is the stack of the Unhandled exception with opcache.jit=tracing

php_opcache!zend_jit_trace_hot_side+0x207:
00007ff8`1bc7f037 492b5068        sub     rdx,qword ptr [r8+68h] ds:000001a4`8b3ac0c0=????????????????
0:000> !analyze -v
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************


KEY_VALUES_STRING: 1

    Key  : AV.Fault
    Value: Read

    Key  : Analysis.CPU.mSec
    Value: 0

    Key  : Analysis.Elapsed.mSec
    Value: 10326

    Key  : Analysis.IO.Other.Mb
    Value: 1

    Key  : Analysis.IO.Read.Mb
    Value: 0

    Key  : Analysis.IO.Write.Mb
    Value: 43

    Key  : Analysis.Init.CPU.mSec
    Value: 15

    Key  : Analysis.Init.Elapsed.mSec
    Value: 5616

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 103

    Key  : Analysis.Version.DbgEng
    Value: 10.0.27704.1001

    Key  : Analysis.Version.Description
    Value: 10.2408.27.01 amd64fre

    Key  : Analysis.Version.Ext
    Value: 1.2408.27.1

    Key  : Failure.Bucket
    Value: INVALID_POINTER_READ_c0000005_php_opcache.dll!zend_jit_trace_hot_side

    Key  : Failure.Hash
    Value: {748c46ce-0a29-b62d-62e8-16ed729a04fd}

    Key  : Timeline.OS.Boot.DeltaSec
    Value: 268208

    Key  : Timeline.Process.Start.DeltaSec
    Value: 16

    Key  : WER.OS.Branch
    Value: ni_release

    Key  : WER.OS.Version
    Value: 10.0.22621.1

    Key  : WER.Process.Version
    Value: 8.4.0.2


FILE_IN_CAB:  php-cgi.exe_241018_185117.dmp

COMMENT:  
*** procdump  -e -w php-cgi
*** Unhandled exception: C0000005.ACCESS_VIOLATION

NTGLOBALFLAG:  0

APPLICATION_VERIFIER_FLAGS:  0

CONTEXT:  (.ecxr)
rax=00007ff81c579480 rbx=000000000000001f rcx=00007ff81bcc9e42
rdx=00007000049b4960 rsi=00000000000002d0 rdi=000000000000009b
rip=00007ff81bc7f037 rsp=000000818cbf7230 rbp=0000000000000000
 r8=000001a48b3ac058  r9=0000700004603f88 r10=0000000000000002
r11=0000000000000000 r12=000000000000001f r13=00000000000004d8
r14=00007ff81bcce7c0 r15=000001a48a2166b0
iopl=0         nv up ei ng nz na pe cy
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010281
php_opcache!zend_jit_trace_hot_side+0x207:
00007ff8`1bc7f037 492b5068        sub     rdx,qword ptr [r8+68h] ds:000001a4`8b3ac0c0=????????????????
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ff81bc7f037 (php_opcache!zend_jit_trace_hot_side+0x0000000000000207)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 000001a48b3ac0c0
Attempt to read from address 000001a48b3ac0c0

PROCESS_NAME:  php-cgi.exe

READ_ADDRESS:  000001a48b3ac0c0 

ERROR_CODE: (NTSTATUS) 0xc0000005 - L'instruction   0x%p emploie l'adresse m moire 0x%p. L' tat de la m moire ne peut pas  tre %s.

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  0000000000000000

EXCEPTION_PARAMETER2:  000001a48b3ac0c0

STACK_TEXT:  
00000081`8cbf7230 00007ff8`1bc7fc4c     : 000001a4`8a3f69b8 000001a4`8a3ac4c0 ffffffff`ffffffff 00000000`0000001f : php_opcache!zend_jit_trace_hot_side+0x207
00000081`8cbfb2f0 00007000`800005a1     : 00000000`0000001f 000001a4`000000c0 00000000`0000000b 00007000`05030aa0 : php_opcache!zend_jit_trace_exit+0x82c
00000081`8cbfb390 00000000`0000001f     : 000001a4`000000c0 00000000`0000000b 00007000`05030aa0 00000000`00000016 : 0x00007000`800005a1
00000081`8cbfb398 000001a4`000000c0     : 00000000`0000000b 00007000`05030aa0 00000000`00000016 00007000`800399e8 : 0x1f
00000081`8cbfb3a0 00000000`0000000b     : 00007000`05030aa0 00000000`00000016 00007000`800399e8 00000000`000000fd : 0x000001a4`000000c0
00000081`8cbfb3a8 00007000`05030aa0     : 00000000`00000016 00007000`800399e8 00000000`000000fd 00000000`000000fd : 0xb
00000081`8cbfb3b0 00000000`00000016     : 00007000`800399e8 00000000`000000fd 00000000`000000fd 00000081`8cbfb4c0 : 0x00007000`05030aa0
00000081`8cbfb3b8 00007000`800399e8     : 00000000`000000fd 00000000`000000fd 00000081`8cbfb4c0 00000000`00000000 : 0x16
00000081`8cbfb3c0 00000000`000000fd     : 00000000`000000fd 00000081`8cbfb4c0 00000000`00000000 000001a4`8a27c000 : 0x00007000`800399e8
00000081`8cbfb3c8 00000000`000000fd     : 00000081`8cbfb4c0 00000000`00000000 000001a4`8a27c000 000001a4`8a27c000 : 0xfd
00000081`8cbfb3d0 00000081`8cbfb4c0     : 00000000`00000000 000001a4`8a27c000 000001a4`8a27c000 00007000`0502df80 : 0xfd
00000081`8cbfb3d8 00000000`00000000     : 000001a4`8a27c000 000001a4`8a27c000 00007000`0502df80 000001a4`8a3d88c0 : 0x00000081`8cbfb4c0


STACK_COMMAND:  ~0s; .ecxr ; kb

FAULTING_SOURCE_LINE:  C:\sdk\src\php-sdk\phpmaster\vs17\x64\php-src\ext\opcache\jit\zend_jit_trace.c

FAULTING_SOURCE_FILE:  C:\sdk\src\php-sdk\phpmaster\vs17\x64\php-src\ext\opcache\jit\zend_jit_trace.c

FAULTING_SOURCE_LINE_NUMBER:  8448

FAULTING_SOURCE_CODE:  
No source found for 'C:\sdk\src\php-sdk\phpmaster\vs17\x64\php-src\ext\opcache\jit\zend_jit_trace.c'


SYMBOL_NAME:  php_opcache!zend_jit_trace_hot_side+207

MODULE_NAME: php_opcache

IMAGE_NAME:  php_opcache.dll

FAILURE_BUCKET_ID:  INVALID_POINTER_READ_c0000005_php_opcache.dll!zend_jit_trace_hot_side

OS_VERSION:  10.0.22621.1

BUILDLAB_STR:  ni_release

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

IMAGE_VERSION:  8.4.0.2

FAILURE_ID_HASH:  {748c46ce-0a29-b62d-62e8-16ed729a04fd}

Followup:     MachineOwner
---------

@nono303
Copy link
Contributor Author

nono303 commented Oct 26, 2024

Hi,
Fyi (and as expected) same issue on 8.4.0rc3

@cmb69
Copy link
Member

cmb69 commented Oct 27, 2024

It's hard to tell what exactly is wrong there; we know:

php_opcache!zend_jit_trace_hot_side+0x207:
00007ff8`1bc7f037 492b5068        sub     rdx,qword ptr [r8+68h] ds:000001a4`8b3ac0c0=????????????????
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007ff81bc7f037 (php_opcache!zend_jit_trace_hot_side+0x0000000000000207)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 000001a48b3ac0c0
Attempt to read from address 000001a48b3ac0c0

Maybe someone accustomed to JIT already would know what might happen there.

When it comes to random OPcache issues on Windows, ASLR is a common suspect. Can you configure opcache.cache_id so that each worker has a different cache_id? If the crashes would still occur, we can exclude ASLR issues.

@nono303
Copy link
Contributor Author

nono303 commented Oct 30, 2024

Can you configure opcache.cache_id so that each worker has a different cache_id?

I know how to configure it by VHost for httpd + fcgid but not by worker.
⏩ if U have some input for this, I'll try it

Note :

  1. ⚠️ with only one php-cgi process handling all fcgid request, the problem still occurs
  2. changing trigger:
  • ✅ with opcache.jit=1235 the problem don't occurs
  • 🔴 with opcache.jit=1255 the problem occurs

@cmb69
Copy link
Member

cmb69 commented Dec 5, 2024

This might be the same issue as #15709.

@cmb69
Copy link
Member

cmb69 commented Jan 7, 2025

Has this now been resolved (via ccc6c0f and possibly some follow-ups)?

@nono303
Copy link
Contributor Author

nono303 commented Jan 7, 2025

Has this now been resolved (via ccc6c0f and possibly some follow-ups)?

Hi @cmb69
Since I build with /safeseh:no LDFLAG (cf. #15709 (comment)) I didn't have issue anymore with opcache JIT trigger=5
Do you want me to test latest 8.4 tag without /safeseh:no LDFLAG ?

@cmb69
Copy link
Member

cmb69 commented Jan 7, 2025

Do you want me to test latest 8.4 tag without /safeseh:no LDFLAG ?

Yeah, that would be great!

@nono303
Copy link
Contributor Author

nono303 commented Jan 7, 2025

Just to be sure before testing...

So do you need a test with a forced _WIN64 or as it?

@cmb69
Copy link
Member

cmb69 commented Jan 7, 2025

So do you need a test with a forced _WIN64 or as it?

_WIN64 is a prefined macro (it is automatically set by the compiler). No need to set it manually.

@nono303
Copy link
Contributor Author

nono303 commented Jan 8, 2025

So I can confirm that without /safeseh:no LDFLAG this issue is now resolved :)

@nono303 nono303 closed this as completed Jan 8, 2025
@cmb69
Copy link
Member

cmb69 commented Jan 8, 2025

Thank you!

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

No branches or pull requests

3 participants