Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
07900 Crash/Freeze Critical (emulator) Always Mar 14, 2021, 23:26 Nov 15, 2022, 09:04
Tester Andrew View Status Public Platform MAME (Official Binary)
Assigned To Resolution Open OS
Status [?] Confirmed Driver
Version 0.229 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 07900: diehard: Crash with -video bgfx -bgfx_backend d3d12
Description MAME crashes when using -video bgfx and -bgfx_backend d3d12. Works fine when not using the bgfx_backend switch. Same result with batmanfr.
Steps To Reproduce E:\emulator-mame>mame diehard -verbose -rompath e:\arcade -video bgfx -bgfx_backend d3d12
Additional Information Attempting load of mame.ini
Attempting load of mame.ini
Attempting load of horizont.ini
Attempting load of arcade.ini
drc_cache: RWX pages supported
drc_cache: RWX pages supported
Attempting load of raster.ini
Parsing raster.ini
Attempting load of source\stv.ini
Attempting load of stvbios.ini
Attempting load of diehard.ini
Reading translation file English: 1 strings, original table at word offset 7, translated table at word offset 9
Loaded 0 translations from file English
Starting plugin data...
Attempting load of mame.ini
Attempting load of mame.ini
Attempting load of horizont.ini
Attempting load of arcade.ini
drc_cache: RWX pages supported
drc_cache: RWX pages supported
Attempting load of raster.ini
Parsing raster.ini
Attempting load of source\stv.ini
Attempting load of stvbios.ini
Attempting load of diehard.ini
drc_cache: RWX pages supported
drc_cache: RWX pages supported
Video: Monitor 2163913 = "\\.\DISPLAY1" (primary)
Video: Monitor 1508503 = "\\.\DISPLAY2"
Physical width 1920, height 1080
RawInput: APIs detected
RawInput: APIs detected
RawInput: APIs detected
DirectSound: Primary buffer: 48000 Hz, 16 bits, 2 channels
Input: Adding keyboard #0: Wireless Keyboard Filter Device (device id: \\?\HID#VID_045E&PID_07B2&MI_00#7&36ea89d4&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding keyboard #1: Standard PS/2 Keyboard (device id: \\?\ACPI#PNP0303#0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding keyboard #2: HID Keyboard Device (device id: \\?\HID#VID_046D&PID_C52B&MI_00#7&a862c1d&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding mouse #0: HID-compliant mouse (device id: \\?\HID#VID_045E&PID_07B2&MI_01&Col01#7&2e08a45c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding mouse #1: HID-compliant mouse (device id: \\?\HID#VID_046D&PID_C52B&MI_01&Col01#7&2249b862&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding lightgun #0: HID-compliant mouse (device id: \\?\HID#VID_045E&PID_07B2&MI_01&Col01#7&2e08a45c&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding lightgun #1: HID-compliant mouse (device id: \\?\HID#VID_046D&PID_C52B&MI_01&Col01#7&2249b862&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd})
Input: Adding joystick #0: Logitech Cordless RumblePad 2 (device id: Logitech Cordless RumblePad 2 product_c219046d-0000-0000-0000-504944564944 instance_72536ec0-3eb3-11ea-8001-444553540000)
unzip: opened archive file e:\arcade\diehard.zip
unzip: found e:\arcade\diehard.zip ECD
unzip: e:\arcade\diehard.zip has no ZIP64 ECD locator
unzip: read e:\arcade\diehard.zip central directory
unzip: closing archive file e:\arcade\diehard.zip and sending to cache
unzip: opened archive file e:\arcade\stvbios.zip
unzip: found e:\arcade\stvbios.zip ECD
unzip: e:\arcade\stvbios.zip has no ZIP64 ECD locator
unzip: read e:\arcade\stvbios.zip central directory
unzip: closing archive file e:\arcade\stvbios.zip and sending to cache
unzip: found e:\arcade\diehard.zip in cache
unzip: opened archive file e:\arcade\diehard.zip
unzip: closing archive file e:\arcade\diehard.zip and sending to cache
unzip: found e:\arcade\diehard.zip in cache
unzip: opened archive file e:\arcade\diehard.zip
unzip: closing archive file e:\arcade\diehard.zip and sending to cache
unzip: found e:\arcade\diehard.zip in cache
unzip: opened archive file e:\arcade\diehard.zip
unzip: closing archive file e:\arcade\diehard.zip and sending to cache
unzip: found e:\arcade\diehard.zip in cache
unzip: opened archive file e:\arcade\diehard.zip
unzip: closing archive file e:\arcade\diehard.zip and sending to cache
unzip: found e:\arcade\diehard.zip in cache
unzip: opened archive file e:\arcade\diehard.zip
unzip: closing archive file e:\arcade\diehard.zip and sending to cache
unzip: opened archive file e:\arcade\segabill.zip
unzip: found e:\arcade\segabill.zip ECD
unzip: e:\arcade\segabill.zip has no ZIP64 ECD locator
unzip: read e:\arcade\segabill.zip central directory
unzip: closing archive file e:\arcade\segabill.zip and sending to cache
Optional device ':hopper' not found
Optional device ':315_5838' not found
Optional device ':315_5881' not found
Optional memory bank ':protbank' not found
Optional device ':rax' not found
Optional device ':stv_slot4' not found
Optional device ':stv_slot3' not found
Optional device ':stv_slot2' not found
Optional device ':stv_slot1' not found
Optional I/O port ':fake' not found
Optional memory region ':smpc:smem' not found
Optional memory region ':eeprom' not found
Optional memory region ':screen' not found
Optional memory region ':scsp' not found
Starting Die Hard Arcade (UET 960515 V1.000) ':'
  (missing dependencies; rescheduling)
Starting Hitachi SH-2 ':maincpu'
Starting Timer ':scantimer'
Starting Hitachi SH-2 ':slave'
Starting Timer ':slave_scantimer'
Starting Motorola MC68000 ':audiocpu'
Starting Sega System Control Unit ':scu'
Starting Sega SCUDSP ':scu:scudsp'
Starting Sega Saturn SMPC HLE (HD404920FS) ':smpc'
Starting NVRAM ':smpc:smem'
Starting Serial EEPROM 93C46 (64x16) ':eeprom'
Starting Video Screen ':screen'
Starting palette ':palette'
Starting gfxdecode ':gfxdecode'
Starting Speaker ':lspeaker'
  (missing dependencies; rescheduling)
Starting Speaker ':rspeaker'
  (missing dependencies; rescheduling)
Starting Yamaha YMF292-F SCSP ':scsp'
Starting Sega Billboard ':billboard'
Starting Zilog Z80 ':billboard:billcpu'
Starting Sega 315-5338A I/O Controller ':billboard:io'
Starting Die Hard Arcade (UET 960515 V1.000) ':'
  (missing dependencies; rescheduling)
Starting Speaker ':lspeaker'
Starting Speaker ':rspeaker'
Starting Die Hard Arcade (UET 960515 V1.000) ':'
Attempting to parse: default.cfg
Attempting to parse: diehard.cfg

-----------------------------------------------------
Exception at EIP=00007fffe6c94521 (register_frame_ctor+0xda7d7f21): ACCESS VIOLATION
While attempting to write memory at 000000003a1b000c
-----------------------------------------------------
RAX=000000003a1af900 RBX=000000000000071c RCX=000000003a1b0010 RDX=000000000dfc0664
RSI=0000000000063880 RDI=0000000000061900 RBP=000000001ea1f9d0 RSP=000000001ea1f9a8
 R8=000000000000000c R9=0000000000000000 R10=0000000045cdaec0 R11=000000003a1b000c
R12=00000000000000e0 R13=000000004810cdf0 R14=000000000000071c R15=00000000000000e0
-----------------------------------------------------
Stack crawl:
  000000001ea1f9a0: 00007fffe6c94521 (memcpy+0x0161)
  000000001ea1f9d0: 0000000006c5bd1d (bx::memCopy(void*, void const*, unsigned long long)+0x000d)
  000000001ea1fbd0: 0000000006be3c6a (bgfx::d3d12::TextureD3D12::update(ID3D12GraphicsCommandList*, unsigned char, unsigned char, bgfx::Rect const&, unsigned short, unsigned short, unsigned short, bgfx::Memory const*)+0x01fa)
  000000001ea1fc30: 000000000a0bc19e (bgfx::d3d12::RendererContextD3D12::updateTexture(bgfx::TextureHandle, unsigned char, unsigned char, bgfx::Rect const&, unsigned short, unsigned short, unsigned short, bgfx::Memory const*)+0x005e)
  000000001ea1fd30: 0000000006bccfe4 (bgfx::Context::flushTextureUpdateBatch(bgfx::CommandBuffer&)+0x0234)
  000000001ea1fea0: 0000000006bcd121 (bgfx::Context::rendererExecCommands(bgfx::CommandBuffer&)+0x00e1)
  000000001ea1fee0: 000000000a0c6707 (bgfx::Context::renderThread(bx::Thread*, void*)+0x00c7)
  000000001ea1ff20: 0000000006c6a6b5 (bx::ThreadInternal::threadFunc(void*)+0x0035)
  000000001ea1ff50: 00007fffe6ae7034 (BaseThreadInitThunk+0x0014)
  000000001ea1ffd0: 00007fffe8ac2651 (RtlUserThreadStart+0x0021)
Github Commit
Flags
Regression Version
Affected Sets / Systems diehard
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
7
User avatar
No.18548
Tafoid
Administrator
Mar 14, 2021, 23:45
Known.
Issue with compiling with certain GCC's apparently
Just drop the -verbose
User avatar
No.18550
Tafoid
Administrator
Mar 15, 2021, 04:14
I've reopened. The crash reported is similar to the one we've been getting with -verbose.
I've tried to duplicate and I cannot get anything at all to crash - using your string and just changing the rompath to match mine.

Can you try adding -norc (no read config) to your string or try running in a freshly installed folder the release version of MAME from mamedev.org?
You could have version mismatched bgfx file or something else? Perhaps other people can try to duplicate?
User avatar
No.18551
Andrew
Tester
Mar 15, 2021, 05:05
edited on: Mar 15, 2021, 12:56
I deleted everything in my MAME folder and installed a fresh 0.229. I used this command line run from my MAME folder

E:\emulator-mame>mame diehard -norc -rompath e:\arcade -video bgfx -bgfx_backend d3d12

and it resulted in a crash after the "CART 1" message was displayed. With subsequent runs, emulation gets past that and crashes after the patents notice is displayed. I then renamed my MAME executable to mame229 and downloaded the Git MAME to the folder and get the same result.
User avatar
No.18560
Osso
Moderator
Mar 15, 2021, 20:15
Getting the following using the command line from the most recent comment, just dropping the -rompath

Thread 7 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 15116.0x2a18]
0x00007ffaf6a04521 in msvcrt!memmove () from C:\WINDOWS\System32\msvcrt.dll
(gdb) bt 10
#0 0x00007ffaf6a04521 in msvcrt!memmove () from C:\WINDOWS\System32\msvcrt.dll
#1 0x000000014b24bb6a in bgfx::d3d12::TextureD3D12::update(ID3D12GraphicsCommandList*, unsigned char, unsigned char, bgfx::Rect const&, unsigned short, unsigned short, unsigned short, bgfx::Memory const*) ()
#2 0x000000014add23d7 in bgfx::Context::flushTextureUpdateBatch(bgfx::CommandBuffer&) ()
#3 0x000000014addd7cf in bgfx::Context::renderThread(bx::Thread*, void*) ()
#4 0x00007ffaf5bf7034 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#5 0x00007ffaf6f22651 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
User avatar
No.18570
Robbbert
Senior Tester
Mar 16, 2021, 13:31
Confirmed crash. Happens while the screen is still black, before any text appears.
The dump is basically nonsense, but seems to point to a bad memcpy.
User avatar
No.18688
Andrew
Tester
Apr 13, 2021, 14:23
Same issue with gtfore06:

E:\emulator-mame>mame.exe gtfore06 -norc -video bgfx -bgfx_backend d3d12 -rompath e:\arcade;e:\arcade-chd
g4c-us-u.u53 NOT FOUND (NO GOOD DUMP KNOWN) (tried in gtfore06 iteagle)
WARNING: the machine might not run correctly.

-----------------------------------------------------
Exception at EIP=00007ffb98ac44d3 (__cxa_throw_bad_array_new_length+0x4c984253): ACCESS VIOLATION
While attempting to write memory at 0000000034fd0000
-----------------------------------------------------
RAX=0000000034fcf800 RBX=0000000000000a80 RCX=0000000034fd0010 RDX=fffffffffa9668e0
RSI=00000000000fc000 RDI=00000000000bf800 RBP=000000000a23f9d0 RSP=000000000a23f9a8
 R8=0000000000000030 R9=0000000000000009 R10=0000000029c37230 R11=000000002f936b60
R12=0000000000000180 R13=000000002f83ab50 R14=0000000000000a80 R15=0000000000000180
-----------------------------------------------------
Stack crawl:
  000000000a23f9a0: 00007ffb98ac44d3 (memcpy+0x0113)
  000000000a23f9d0: 000000014a68bfad (bx::memCopy(void*, void const*, unsigned long long)+0x000d)
  000000000a23fbd0: 000000014aaf9e9a (bgfx::d3d12::TextureD3D12::update(ID3D12GraphicsCommandList*, unsigned char, unsigned char, bgfx::Rect const&, unsigned short, unsigned short, unsigned short, bgfx::Memory const*)+0x01fa)
  000000000a23fc30: 000000014ab0951e (bgfx::d3d12::RendererContextD3D12::updateTexture(bgfx::TextureHandle, unsigned char, unsigned char, bgfx::Rect const&, unsigned short, unsigned short, unsigned short, bgfx::Memory const*)+0x005e)
  000000000a23fd30: 000000014a6a4d24 (bgfx::Context::flushTextureUpdateBatch(bgfx::CommandBuffer&)+0x0234)
  000000000a23fea0: 000000014a6a4e61 (bgfx::Context::rendererExecCommands(bgfx::CommandBuffer&)+0x00e1)
  000000000a23fee0: 000000014a6b0007 (bgfx::Context::renderThread(bx::Thread*, void*)+0x00c7)
  000000000a23ff20: 000000014aaca845 (bx::ThreadInternal::threadFunc(void*)+0x0035)
  000000000a23ff50: 00007ffb9a017034 (BaseThreadInitThunk+0x0014)
  000000000a23ffd0: 00007ffb9a722651 (RtlUserThreadStart+0x0021)
User avatar
No.20820
Firewave
Senior Tester
Nov 15, 2022, 09:04
edited on: Dec 5, 2022, 20:06
I can still reproduce this with the official 0.249 Windows binary. I also tried all other BGFX backends and they are working fine.

I am not able to reproduce this with any BGFX backend on Linux. But I wonder if this might have a similar cause as https://mametesters.org/view.php?id=8512