Retroarch occasionally crashes when opening f1 menu

Ever since updating to the latest version of Retroarch, with the latest assets and cores, I have been getting occasional crashing when opening the menu with either f1 or a button combination on my controller. This happens perhaps 1/50 times I try to open the menu, and it’s extremely anticlimactic; Retroarch just hangs for a second and then closes; no error message pops up. It can happen the first time I try to open the menu, even right after launching Retroarch, or it can happen after Retroarch has been open for half an hour, with the menu having been successfully opened dozens of times before it crashed.

Since I use the menu to access save states when playing with a controller, I can’t stand to have Retroarch crashing when opening the menu, even if there’s only a 1% chance of that happening. I could lose all my progress in a game like Super Mario Bros. 3, which has no built-in saving for the NES version, if I played through say half of it in one sitting, tried to open the menu to make a save state to be able to continue later, only to then have Retroarch crash on me.

I’m struggling to figure out the source of this issue, but when I go to check the Windows Event Viewer, I see an associated app crash whenever this happens, with the faulting module name “msvcrt.dll” and an “Access Violation”; I have no idea why or how. I have included the Retroarch log for one example of this crashing, along with a log from AppCrashView, so that someone might be able to look at it and possibly get this problem solved.

Retroarch AppCrashView

Retroarch Log

Windows crash log is useless, so only a proper stack trace would help.

But I suspect the reason is d3d12 which has always been dodgy. Use d3d11 instead (if vulkan or glcore does not work), since there is no benefit in the “newer” one. I’ve never had random crashes with any other video driver than d3d12, which especially crashes almost certainly after running multiple contents without quitting.

I switched to d3d11, and sure enough, using d3d12 was indeed the problem. Thanks!