Zink: Hang/Crash in PCSX2 with Windows MinGW build
System information
- OS: Windows 10 20H2
- GPU: Nvidia RTX 2070 (Driver version 461.72)
- Mesa version: 21.0, Also tested master (commit c022c960)
Describe the issue
PCSX2 will hang or crash after starting emulation (PCSX2->Boot ISO).
When debugging PCSX2 with visual studio, I see that the issue occurs on the call to ChoosePixelFormat(), which raises an access violation.
Log files as attachment
I used a debugoptimised build of Mesa, attached GBD and stepped though until I got the hang (I wasn't able to break on the exception) see attached output
Thread 16 "MTGS" hit Breakpoint 1, zink_destroy_screen (pscreen=0x16200100)
at ../../src/gallium/drivers/zink/zink_screen.c:912
912 vkDestroyPipelineCache(screen->dev, screen->pipeline_cache, NULL);
(gdb) step
914 vkDestroyDevice(screen->dev, NULL);
(gdb) bt
#0 zink_destroy_screen (pscreen=0x16200100) at ../../src/gallium/drivers/zink/zink_screen.c:914
#1 0x1b05c3f2 in stw_cleanup () at ../../src/gallium/frontends/wgl/stw_device.c:222
#2 0x1a9c676a in DllMain@12 (hinstDLL=hinstDLL@entry=0x1a9a0000, fdwReason=fdwReason@entry=0,
lpvReserved=lpvReserved@entry=0x0) at ../../src/gallium/targets/libgl-gdi/libgl_gdi.c:303
#3 0x1a9a1259 in __DllMainCRTStartup (hDllHandle=hDllHandle@entry=0x1a9a0000, dwReason=dwReason@entry=0,
lpreserved=lpreserved@entry=0x0) at C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:185
#4 0x1a9a13ce in DllMainCRTStartup@12 (hDllHandle=0x1a9a0000, dwReason=0, lpreserved=0x0)
at C:/_/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:155
#5 0x778a2b56 in ntdll!RtlIpv6AddressToStringA () from C:\WINDOWS\SysWOW64\ntdll.dll
#6 0x7787dbd2 in ntdll!RtlActivateActivationContextUnsafeFast () from C:\WINDOWS\SysWOW64\ntdll.dll
#7 0x7788a68a in ntdll!LdrUnloadAlternateResourceModuleEx () from C:\WINDOWS\SysWOW64\ntdll.dll
#8 0x00000000 in ?? ()
(gdb) p screen
$1 = (struct zink_screen *) 0x16200100
(gdb) p vkDestroyDevice
$2 = {<text variable, no debug info>} 0x20ceb930 <vulkan-1!vkDestroyDevice>
(gdb) p screen->dev
$3 = (VkDevice) 0x18fdbfac
(gdb) step
<Hangs>
See https://github.com/pal1000/mesa-dist-win/issues/54 for more information