Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
09091 Crash/Freeze Critical (emulator) Always 16 days ago 11 days ago
Tester trebor View Status Public Platform MAME (Official Binary)
Assigned To Resolution Open OS Windows 10/11 (64-bit)
Status [?] Acknowledged Driver
Version 0.273 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 09091: punchout, spnchout: Access Violation crash with numscreens 2 for ini file under bgfx video
Description When trying to utilize two displays for the games Punch-Out!! and Super Punch-Out!!, creating the respective *.ini file, specifying 'numscreens 2' results in an Access Violation crash.

Delete the *.ini file, or just remove the 'numscreens 2' line, both games run without issue.
Steps To Reproduce Create a punchout.ini or spnchout.ini file and place the line numscreens 2. Run "mame punchout" (or "mame spnchout")

MAME crashes with an Access Violation error:

D:\MAME>mame punchout
-----------------------------------------------------
Exception at EIP=00007ff6ad530a94 (bgfx::d3d11::RendererContextD3D11::init(bgfx::Init const&)+0x1224): ACCESS VIOLATION
While attempting to read memory at 00007ff6b8574750
-----------------------------------------------------
RAX=0000000004000010 RBX=0000016e04dc1040 RCX=0000016e04dce3d8 RDX=0000000000000007
RSI=00000004b30f8b40 RDI=00007ff6b4574e70 RBP=00007ff6b45743a0 RSP=00000004b30f8a90
 R8=ffffffffffffffe0 R9=0000016e04dce408 R10=baac1f10365eb170 R11=00000004b30f8a60
R12=00007ff6b4574740 R13=00000004b30f8b40 R14=0000016e04dc1040 R15=0000000000000001
-----------------------------------------------------
Stack crawl:
  00000004b30f8f80: 00007ff6ad530a94 (luaopen_lfs+0x9b3314)
  00000004b30f8fd0: 00007ff6ad528785 (luaopen_lfs+0x9ab005)
  00000004b30f9120: 00007ff6ad07ba44 (luaopen_lfs+0x4fe2c4)
  00000004b30f92e0: 00007ff6ad08ad96 (luaopen_lfs+0x50d616)
  00000004b30f9340: 00007ff6ad08ae22 (luaopen_lfs+0x50d6a2)
  00000004b30f93b0: 00007ff6ad08b4fd (luaopen_lfs+0x50dd7d)
  00000004b30f9420: 00007ff6ad08b822 (luaopen_lfs+0x50e0a2)
  00000004b30f9450: 00007ff6ad08c1c3 (luaopen_lfs+0x50ea43)
  00000004b30f95a0: 00007ff6abebfc37 (renderer_bgfx::draw(int)+0x0647)
  00000004b30f9600: 00007ff6a7f55973 (win_window_info::draw_video_contents(HDC__*, bool)+0x0063)
  00000004b30f9710: 00007ff6a7f5a166 (win_window_info::video_window_proc(HWND__*, unsigned int, unsigned long long, long long)+0x0736)


Remove the numscreens line or delete the ini file and the game runs fine under just one screen.
Additional Information I'm running an 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz | 2.50 GHz desktop. 16.0 GB (15.6 GB usable). Windows 11 Home. Version 23H2. NVIDIA GeForce GTX 1660 Ti. Driver Version 32.0.15.5612.
Github Commit
Flags
Regression Version
Affected Sets / Systems punchout, spnchout
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
10
User avatar
No.22870
Robbbert
Moderator
16 days ago
edited on: 16 days ago
Works for me - no crash. Using "auto" video on Windows 10.

You haven't said what video setting you're using. Going by the dump it appears to be

-video bgfx -bgfx_backend d3d11

I tried that and it still worked.
User avatar
No.22871
trebor
Tester
16 days ago
edited on: 16 days ago
You actually nailed the cause for me.

Starting with a clean/brand new install folder

If I have this set in mame.ini...

# OSD VIDEO OPTIONS
#
video auto

The above with numscreens 2 enabled in punchout.ini file created runs fine.

However...

# OSD VIDEO OPTIONS
#
video bgfx

The above with numscreens 2 enabled in punchout.ini file created crashes mame.
User avatar
No.22872
trebor
Tester
16 days ago
I updated the Report Summary to better reflect the issue.
User avatar
No.22873
Robbbert
Moderator
16 days ago
Have to wait for what other people say, since it works for me.
User avatar
No.22882
Robbbert
Moderator
14 days ago
Setting this to acknowledged, pending someone, anyone, able to confirm a crash.
User avatar
No.22885
hap
Developer
14 days ago
What about other 2-screen games?
I don't have 2 monitors connected, so I can't try.

Does it crash with this for you? (works ok here):
mame punchout -view 6 -video bgfx -nowindow
User avatar
No.22886
Robbbert
Moderator
14 days ago
I don't have 2 monitors either, so it just gives 2 windows, one for each screen. You can move them around so you can see them both at the same time.

I don't know what "view 6" does, but your test just showed the 2 screens one above the other.
User avatar
No.22888
hap
Developer
14 days ago
That was for trebor.
As for view 6, that selects one screen, so I was wondering if punchout also crashes with a single screen on his pc (no -numscreens 2).
User avatar
No.22907
ICEknight
Tester
11 days ago
edited on: 11 days ago
I have three screens connected and just checked. Having numscreens 2 in mame.ini also makes it crash for me right away (even before it shows MAME's initial menu):
-----------------------------------------------------
Exception at EIP=00007ff66a2faeea (not found): ACCESS VIOLATION
While attempting to read memory at 000002cee2ce2c18
-----------------------------------------------------
RAX=00000000000c7412 RBX=0000000000000000 RCX=000002cecadc0d18 RDX=000000e3992f7e24
RSI=0000000000000042 RDI=0000000000000000 RBP=00000000000c7412 RSP=000000e3992f7de0
 R8=000002cee29c5040 R9=0000000000000007 R10=0000000000000001 R11=000002cecad9b660
R12=000002cecadc0ce0 R13=00007ff67145cd80 R14=00000000000c76f6 R15=00007ff672c685a8
-----------------------------------------------------
Stack crawl:
  000000e3992f7e70: 00007ff66a2faeea (luaopen_lfs+0x70725a)
  000000e3992f7fa0: 00007ff66a2fafda (luaopen_lfs+0x70734a)
  000000e3992f8060: 00007ff66a2fba97 (luaopen_lfs+0x707e07)
  000000e3992f8b50: 00007ff66a30d4a4 (luaopen_lfs+0x719814)
  000000e3992f8ba0: 00007ff66a2fead3 (luaopen_lfs+0x70ae43)
  000000e3992f8cf0: 00007ff669dc0a60 (luaopen_lfs+0x1ccdd0)
  000000e3992f8e60: 00007ff669dcf490 (luaopen_lfs+0x1db800)
  000000e3992f8ec0: 00007ff669dcf521 (luaopen_lfs+0x1db891)
  000000e3992f8f30: 00007ff669dcfbbd (luaopen_lfs+0x1dbf2d)
  000000e3992f8fa0: 00007ff669dcfee0 (luaopen_lfs+0x1dc250)
  000000e3992f90f0: 00007ff668c30e07 (not found)
  000000e3992f9150: 00007ff664dd02fb (not found)
  000000e3992f9250: 00007ff664dd4c56 (not found)
  000000e3992f93e0: 00007ffdb09bef5c (CallWindowProcW+0x060c)
  000000e3992f9430: 00007ffdb09be9de (CallWindowProcW+0x008e)
  000000e3992f94a0: 00007ffd6020f1f0 (glPushClientAttrib+0x15090)
  000000e3992f9630: 00007ffdb09bef5c (CallWindowProcW+0x060c)
  000000e3992f9690: 00007ffdb09be8cc (DispatchMessageW+0x06ec)
  000000e3992f96f0: 00007ffdb09d10c3 (SendMessageTimeoutW+0x0143)
  000000e3992f9778: 00007ffdb2291374 (KiUserCallbackDispatcher+0x0024)
  000000e3992f9780: 00007ffdb0071124 (NtUserMessageCall+0x0014)
  000000e3992f9820: 00007ffdb09be0a2 (SendMessageW+0x0a12)
  000000e3992f9880: 00007ffdb09bd814 (SendMessageW+0x0184)
  000000e3992f98c0: 00007ff664dde8ea (not found)
  000000e3992f9950: 00007ff664e57e19 (not found)
  000000e3992f9ad0: 00007ff661c36c53 (not found)
  000000e3992ff0f0: 00007ff664db431f (not found)
  000000e3992ff4e0: 00007ff668b974cc (not found)
  000000e3992ff7c0: 00007ff668b97abf (not found)
  000000e3992ff820: 00007ff664daf357 (not found)
  000000e3992ffbe0: 00007ff66a89bb6f (luaopen_lfs+0xca7edf)
  000000e3992ffc30: 00007ff65d9912e9 (not found)
  000000e3992ffc60: 00007ff65d9913f6 (not found)
  000000e3992ffc90: 00007ffdb13a7374 (BaseThreadInitThunk+0x0014)
  000000e3992ffd10: 00007ffdb223cc91 (RtlUserThreadStart+0x0021)

However, numscreen 3 does allow me to reach the menu, but launching Punch Out (or any other game) makes it crash:
-----------------------------------------------------
Exception at EIP=00007ff66a2faeea (not found): ACCESS VIOLATION
While attempting to read memory at 00000213c0180c18
-----------------------------------------------------
RAX=00000000000c7412 RBX=0000000000000000 RCX=00000213b10638c8 RDX=0000005bd83e7794
RSI=0000000000000042 RDI=0000000000000000 RBP=00000000000c7412 RSP=0000005bd83e7750
 R8=00000213bfe63040 R9=0000000000000007 R10=0000000000000001 R11=00000213ac72a920
R12=00000213b1063890 R13=00007ff67145cd80 R14=00000000000c76f6 R15=00007ff672c685a8
-----------------------------------------------------
Stack crawl:
  0000005bd83e77e0: 00007ff66a2faeea (luaopen_lfs+0x70725a)
  0000005bd83e7910: 00007ff66a2fafda (luaopen_lfs+0x70734a)
  0000005bd83e79d0: 00007ff66a2fba97 (luaopen_lfs+0x707e07)
  0000005bd83e84c0: 00007ff66a30d4a4 (luaopen_lfs+0x719814)
  0000005bd83e8510: 00007ff66a2fead3 (luaopen_lfs+0x70ae43)
  0000005bd83e8660: 00007ff669dc0a60 (luaopen_lfs+0x1ccdd0)
  0000005bd83e87d0: 00007ff669dcf490 (luaopen_lfs+0x1db800)
  0000005bd83e8830: 00007ff669dcf521 (luaopen_lfs+0x1db891)
  0000005bd83e88a0: 00007ff669dcfbbd (luaopen_lfs+0x1dbf2d)
  0000005bd83e8910: 00007ff669dcfee0 (luaopen_lfs+0x1dc250)
  0000005bd83e8a60: 00007ff668c30e07 (not found)
  0000005bd83e8ac0: 00007ff664dd02fb (not found)
  0000005bd83e8bc0: 00007ff664dd4c56 (not found)
  0000005bd83e8d50: 00007ffdb09bef5c (CallWindowProcW+0x060c)
  0000005bd83e8da0: 00007ffdb09be9de (CallWindowProcW+0x008e)
  0000005bd83e8e10: 00007ffd6020f1f0 (glPushClientAttrib+0x15090)
  0000005bd83e8fa0: 00007ffdb09bef5c (CallWindowProcW+0x060c)
  0000005bd83e9000: 00007ffdb09be8cc (DispatchMessageW+0x06ec)
  0000005bd83e9060: 00007ffdb09d10c3 (SendMessageTimeoutW+0x0143)
  0000005bd83e90e8: 00007ffdb2291374 (KiUserCallbackDispatcher+0x0024)
  0000005bd83e90f0: 00007ffdb0071124 (NtUserMessageCall+0x0014)
  0000005bd83e9190: 00007ffdb09be0a2 (SendMessageW+0x0a12)
  0000005bd83e91f0: 00007ffdb09bd814 (SendMessageW+0x0184)
  0000005bd83e9230: 00007ff664dde8ea (not found)
  0000005bd83e92c0: 00007ff664e57e78 (not found)
  0000005bd83e9610: 00007ff668b55935 (not found)
  0000005bd83e9790: 00007ff661c36e95 (not found)
  0000005bd83eedb0: 00007ff664db431f (not found)
  0000005bd83ef1a0: 00007ff668b974cc (not found)
  0000005bd83ef480: 00007ff668b97abf (not found)
  0000005bd83ef4e0: 00007ff664daf357 (not found)
  0000005bd83ef8a0: 00007ff66a89bb6f (luaopen_lfs+0xca7edf)
  0000005bd83ef8f0: 00007ff65d9912e9 (not found)
  0000005bd83ef920: 00007ff65d9913f6 (not found)
  0000005bd83ef950: 00007ffdb13a7374 (BaseThreadInitThunk+0x0014)
  0000005bd83ef9d0: 00007ffdb223cc91 (RtlUserThreadStart+0x0021)
User avatar
No.22908
ICEknight
Tester
11 days ago
edited on: 11 days ago
Strangely enough, if I'm quick with the mouse and click on MAME's taskbar icon before the crash, MAME's windows will be restored in time and the game will run properly.

It looks like, for some reason, only the last monitor starts with MAME's window in full screen and the others have to be restored manually by clicking on any of their icons.