Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08123 Graphics Critical (emulator) Always Nov 2, 2021, 09:42 Nov 4, 2021, 14:12
Tester hap View Status Public Platform MAME (Official Binary)
Assigned To Resolution Open OS Windows 10/11 (64-bit)
Status [?] Acknowledged Driver
Version 0.237 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 08123: bgfx vulkan sometimes crashes when resizing window
Description Windows 10 here, nvidia GPU.

mame 1942 -video bgfx -bgfx_backend vulkan -window -waitvsync -skip_gameinfo
Grab top edge of the window and resize fast, MAME crashes:

-----------------------------------------------------
Exception at EIP=00007ffe6b03f304 (__cxa_throw_bad_array_new_length+0x1ebeab54): ACCESS VIOLATION
While attempting to read memory at 00000000000000a0
-----------------------------------------------------
RAX=0000000000000000 RBX=000000000b087c18 RCX=000000000b087c18 RDX=0000000007f1f630
RSI=0000000007f1f700 RDI=0000000007f1f630 RBP=0000000007f1fb01 RSP=0000000007f1f5a0
 R8=0000000000000016 R9=000000000872b901 R10=0000000000000000 R11=0000000000000007
R12=0000000000000001 R13=0000000000000000 R14=00000000087c1310 R15=0000000011c6c8f0
-----------------------------------------------------
Stack crawl:
  0000000007f1f5e0: 00007ffe6b03f304 (vkGetInstanceProcAddr+0x39294)
  0000000007f1f690: 00007ffe6b02d973 (vkGetInstanceProcAddr+0x27903)
  0000000007f1f760: 000000014ad99dba (bgfx::vk::BufferVK::update(VkCommandBuffer_T*, unsigned int, unsigned int, void*, bool)+0x008a)
  0000000007f1fe50: 000000014ada68ff (bgfx::vk::RendererContextVK::submit(bgfx::Frame*, bgfx::ClearQuad&, bgfx::TextVideoMemBlitter&)+0x1f5f)
  0000000007f1feb0: 000000014a8e0505 (bgfx::Context::renderFrame(int)+0x00c5)
  0000000007f1fef0: 000000014a8ea4f2 (bgfx::Context::renderThread(bx::Thread*, void*)+0x0022)
  0000000007f1ff20: 000000014ad3b08c (bx::ThreadInternal::threadFunc(void*)+0x002c)
  0000000007f1ff50: 00007ffed8d57034 (BaseThreadInitThunk+0x0014)
  0000000007f1ffd0: 00007ffeda7a2651 (RtlUserThreadStart+0x0021)
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems
Attached Files
png file icon pongf Screenshot_2021-11-05_00-48-17.png (87,548 bytes) Nov 4, 2021, 13:54 Uploaded by ozfalcon
Mirrored screenshot
ozfalcon
Relationships
There are no relationship linked to this issue.
Notes
8
User avatar
No.19410
hap
Developer
Nov 2, 2021, 09:45
I assume it's a Windows-only issue, someone can try on another OS?
And does it happen on AMD GPUs?
User avatar
No.19412
Robbbert
Developer
Nov 2, 2021, 12:59
edited on: Nov 2, 2021, 13:00
I'm using NVIDIA GeForce GT 710.
Windows 10 latest forced updates. Version 10.0.19042.1288

MAME - latest git.

No crashes.
User avatar
No.19413
hap
Developer
Nov 2, 2021, 13:09
From discord:

crash:
duke (I don't know which GPU)
dirthead (nvidia)
naoki (nvidia)

no crash
naoki (intel)
User avatar
No.19416
sairuk
Tester
Nov 3, 2021, 20:43
Could not replicate this on AMD

No crash
- Win10 Radeon RX580 (fresh win10 install (updated), 237 release binary, latest AMD drivers)
- Ubuntu 20.04 Radeon RX580 (compiled 237 dirty)

Run with:
mame -waitvsync -skip_gameinfo -window -video bgfx -bgfx_backend vulkan -bgfx_debug -bgfx_screen_chains %CHAIN% -rompath %ROMPATH% %ROM%

where CHAIN was both auto and crt-geom-deluxe and ROM was 1942 and pacman

no crash reports should probably be rerun with -bgfx_debug to confirm vulkan backend is in use and mame has not fallen back to d3d which I noted happened on a non vulkan gpu and no crash.
User avatar
No.19417
gspat
Tester
Nov 3, 2021, 22:30
Can confirm crash :
AMD 2400g/Nvidia gtx960/16gb/win10

-bgfx_debug shows using vulkan and gtx960

C:\mame\msys64\src\mame>mame 1942 -video bgfx -bgfx_backend vulkan -bgfx_debug -window -waitvsync -skip_gameinfo

-----------------------------------------------------
Exception at EIP=000000007263e381 (not found): ACCESS VIOLATION
While attempting to read memory at 0000000000000070
-----------------------------------------------------
RAX=0000000000000000 RBX=000001d6b13a1e90 RCX=000001d6a251e418 RDX=0000006cb39ff1c8
RSI=0000006cb39ff1c8 RDI=000001d6a251e418 RBP=0000006cb39ff230 RSP=0000006cb39ff0d0
 R8=0000000000000016 R9=0000000000000001 R10=0000000000000000 R11=0000000000000007
R12=0000000000000001 R13=0000006cb39ff601 R14=000001d69cef4040 R15=0000006cb39ff6d8
-----------------------------------------------------
Stack crawl:
  0000006cb39ff120: 000000007263e381 (vkGetInstanceProcAddr+0xac21)
  0000006cb39ff660: 000000007263f52d (vkGetInstanceProcAddr+0xbdcd)
  0000006cb39ff730: 00007ff6b32cdcba (not found)
  0000006cb39ffe20: 00007ff6b32da81f (not found)
  0000006cb39ffe80: 00007ff6b32949a5 (not found)
  0000006cb39ffec0: 00007ff6b5d6a7e2 (not found)
  0000006cb39ffef0: 00007ffa33cc7034 (BaseThreadInitThunk+0x0014)
  0000006cb39fff70: 00007ffa340c2651 (RtlUserThreadStart+0x0021)
User avatar
No.19418
cuavas
Administrator
Nov 3, 2021, 23:44
I can get it to happen on Win10 with NVIDIA GeForce, but not reliably – sometimes I have to resize the window lots of times before it happens. The -waitvsync is a red herring, it can happen with -nowaitvsync as well. It's just somewhat random whether it will happen on any given resize.
User avatar
No.19419
ozfalcon
Tester
Nov 4, 2021, 13:53
edited on: Nov 4, 2021, 14:13
Happens here on Debian 11 Linux. Though I am using local compiled subtarget arcade.
#>./sdlmamearcade64.V0237.Mainline pongf -video bgfx -bgfx_backend vulkan -bgfx_debug -window -skip_gameinfo

I can't resize very much before it chokes or seg faults.
V0228 Seems to choke as well but doesn't seg fault.

Interestingly I left -skip_gameinfo on and noticed it was mirrored. (Uploaded).
And I also got ALOT of warnings with -verbose enabled
(Mame 0228 does not display these warnings nor was it mirrored)
Starting Pong (Rev E) [TTL]
Warning: Attempting to retrieve a nonexistent target 'temp' for screen 0
Warning: Attempting to retrieve a nonexistent target 'temp' for screen 0
.....

Note:Never used bgfx or vulcan before so not sure all is as should be on this machine.
User avatar
No.19420
hap
Developer
Nov 4, 2021, 14:12
Those unrelated verbose warnings are fixed in 0.238