mesa-dist-win icon indicating copy to clipboard operation
mesa-dist-win copied to clipboard

23.1.4 msvc build regression: crashes on Server 2012 R2 and 2016 with 0xc0000005 upon context creation

Open Optiligence opened this issue 1 year ago • 12 comments

also broken with 23.1.5

no issue with Server 2019

https://ci.appveyor.com/project/knossos/knossos/builds/47779695 unfortunately needs QT_OPENGL_DLL=opengl32 to even pick it up (workaround for https://github.com/qt/qtbase/commit/6c85067ba51fae169b99538b2ba3a5dd30348227#diff-30d85ae3c18697e52d180edc79bb5eefcb74f970957dc73b3a766541088a5237)

Optiligence avatar Aug 12 '23 19:08 Optiligence

Try setting GALLIUM_DRIVER=llvmpipe and GALLIUM_DRIVER=d3d12 respectively. This should rule out which driver is crashing. GALLIUM_DRIVER=d3d12 cannot work on Server 2012 R2 and even 2016 may be too old.

pal1000 avatar Aug 14 '23 13:08 pal1000

both actually work https://ci.appveyor.com/project/knossos/knossos/builds/47820989 :see_no_evil:

Optiligence avatar Aug 17 '23 19:08 Optiligence

So explicitly selecting a driver works around this issue?

Also it appears knossos or rather QT is smart enough to handle context creation failure followed by clean exit otherwise things would blow up on VS2015/2017 MSVC d3d12 configurations.

pal1000 avatar Aug 18 '23 10:08 pal1000

We definitely need this reported upstream as I was able to reproduce it with GPU Caps Viewer (32-bit software) using both 23.1.9 and 23.2.1 and inform Mesa3D main MSVC build developer @jenatali.

pal1000 avatar Oct 10 '23 16:10 pal1000

What's the call stack for the crash?

jenatali avatar Oct 10 '23 16:10 jenatali

Call stack with 23.1.9, but it can be reproduced with 23.2.1 too. GPU Caps Viewer is a 32-bit x86 app. Some PCs can't reproduce, maybe CPU matters. I couldn't reproduce on the Petrosky VPS I use to build Mesa3D running on AMD EPYC 7413. Screenshot 2023-10-11 030846

>	ntdll.dll!RtlpWaitOnCriticalSection()	Unknown
 	ntdll.dll!RtlpEnterCriticalSectionContended()	Unknown
 	ntdll.dll!_RtlEnterCriticalSection@4()	Unknown
 	libgallium_wgl.dll!mtx_lock(mtx_t * mtx) Line 245	C
 	[Inline Frame] libgallium_wgl.dll!util_queue_kill_threads(util_queue *) Line 503	C
 	libgallium_wgl.dll!util_queue_destroy(util_queue * queue) Line 543	C
 	libgallium_wgl.dll!zink_internal_create_screen(const pipe_screen_config * config) Line 3091	C
 	libgallium_wgl.dll!zink_create_screen(sw_winsys * winsys, const pipe_screen_config * config) Line 3100	C
 	[Inline Frame] libgallium_wgl.dll!wgl_screen_create_by_name(HDC__ * driver, const char *) Line 99	C
 	libgallium_wgl.dll!wgl_screen_create(HDC__ * hDC) Line 143	C
 	[Inline Frame] libgallium_wgl.dll!init_screen(const stw_winsys * stw_winsys, HDC__ *) Line 95	C
 	libgallium_wgl.dll!stw_init_screen(HDC__ * hdc) Line 189	C
 	[Inline Frame] libgallium_wgl.dll!stw_pixelformat_get_extended_count(HDC__ *) Line 365	C
 	libgallium_wgl.dll!stw_pixelformat_choose(HDC__ * hdc, const tagPIXELFORMATDESCRIPTOR * ppfd) Line 515	C
 	opengl32.dll!wglChoosePixelFormat(HDC__ * hdc, const tagPIXELFORMATDESCRIPTOR * ppfd) Line 166	C
 	[External Code]	
 	[Frames below may be incorrect and/or missing, no symbols loaded for GPU_Caps_Viewer.exe]	

pal1000 avatar Oct 11 '23 00:10 pal1000

@zmike looks like a Zink bug if it fails to initialize, it tries to lock an invalid mutex during cleanup.

jenatali avatar Oct 11 '23 03:10 jenatali

🤕

zmike avatar Oct 11 '23 09:10 zmike

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25663 probably fixes it

zmike avatar Oct 11 '23 16:10 zmike

@Optiligence, please test 23.3.0-rrc1. It includes the fix worked by @zmike.

pal1000 avatar Oct 31 '23 15:10 pal1000

before crashing, it now prints

MESA: error: ZINK: failed to load vulkan-1.dll

23.2.1 does so as well

Optiligence avatar Oct 31 '23 16:10 Optiligence

before crashing, it now prints

MESA: error: ZINK: failed to load vulkan-1.dll

So this issue returns. You can workaround it by installing Vulkan runtime.

23.2.1 does so as well

23.2.1 should crash just like 23.1 series as it doesn't include the fix which means this is a race condition.

pal1000 avatar Oct 31 '23 20:10 pal1000