Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
09004 Crash/Freeze Minor Always Dec 7, 2024, 14:08 29 days ago
Tester Robbbert View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Invalid report OS Windows 10/11 (64-bit)
Status [?] Closed Driver
Version 0.272 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 09004: mononcol: If run without a cart, it crashes at start
Description If you run this system without a cartridge, for example in the debugger, it will crash.
Steps To Reproduce >mame mononcol -d

In the debugger use the g command.

It will crash, dump, and exit.
Additional Information C:\MAME>mame mononcol -d
music_mcu.bin ROM NEEDS REDUMP
WARNING: the machine might not run correctly.

-----------------------------------------------------
Exception at EIP=00007ff75777194e ((anonymous namespace)::monon_color_state::spidir_w(int)+0x000e): ACCESS VIOLATION
While attempting to read memory at 0000000000000000
-----------------------------------------------------
RAX=000001e670b36e20 RBX=000001e6737058a0 RCX=0000000000000000 RDX=0000000000000000
RSI=000001e670bf37d0 RDI=0000000000000000 RBP=00007ff768016e80 RSP=0000003be3af94d8
 R8=0000003be3af9518 R9=0000003be3af9514 R10=0000000000000001 R11=fffffffff666ea26
R12=000001e670bf32f0 R13=000001e670bf32dc R14=000001e670bf32e0 R15=0000003be3af9980
-----------------------------------------------------
Stack crawl:
  0000003be3af94d0: 00007ff75777194e ((anonymous namespace)::monon_color_state::spidir_w(int)+0x000e)
  0000003be3af9550: 00007ff759757f95 (devcb_write<int, 1u>::operator()(int)+0x0045)
  0000003be3af95c0: 00007ff75baee5f8 (axc51base_cpu_device::execute_run()+0x00d8)
  0000003be3af9640: 00007ff759882f53 (device_scheduler::timeslice()+0x0323)
  0000003be3af97c0: 00007ff75987ffc5 (running_machine::run(bool)+0x01c5)
  0000003be3afede0: 00007ff75c9d202c (mame_machine_manager::execute()+0x024c)
  0000003be3aff1d0: 00007ff7606f03da (cli_frontend::start_execution(mame_machine_manager*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x03ea)
  0000003be3aff4e0: 00007ff7606f0a0a (cli_frontend::execute(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)+0x007a)
  0000003be3aff540: 00007ff75c9ccdd7 (emulator_info::start_frontend(emu_options&, osd_interface&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)+0x0027)
  0000003be3aff910: 00007ff762385c51 (luaopen_lfs+0xc5e771)
  0000003be3aff960: 00007ff755ae12ee (__tmainCRTStartup+0x016e)
  0000003be3aff990: 00007ff755ae1406 (mainCRTStartup+0x0016)
  0000003be3aff9c0: 00007ffb419c7374 (BaseThreadInitThunk+0x0014)
  0000003be3affa40: 00007ffb4219cc91 (RtlUserThreadStart+0x0021)
Github Commit
Flags
Regression Version
Affected Sets / Systems mononcol
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
6
User avatar
No.22601
cuavas
Administrator
Dec 18, 2024, 09:31
This system requires a cartridge to be loaded:

    mononcol_cartslot_device &cartslot(MONONCOL_CARTSLOT(config, "cartslot", mononcol_plain_slot));
    cartslot.set_must_be_loaded(true);

Intentionally bypassing that is not supported.
User avatar
No.22608
hap
Developer
Dec 18, 2024, 12:59
It is supported:
mame videopac -debug
mame videopac -bench 3
User avatar
No.22610
cuavas
Administrator
Dec 18, 2024, 14:40
No, MAME is incorrectly failing to raise the fatal error when certain options are used. MAME does not support running systems with nothing mounted in media devices that are marked required.
User avatar
No.22611
Haze
Senior Tester
Dec 18, 2024, 14:51
It should probably in this case be possible to debug the internal ROM rather than just crashing, as unlike some systems there is at least that even when no cart exists, but yeah, I didn't realise -debug bypassed the mandatory requirement entirely, that seems like an issue beyond this report as for some systems there will simply be no code at all in such cases.
User avatar
No.22692
Robbbert
Moderator
29 days ago
Fixed this in my build, only had to add guards if a cart was there or not. Easy job.
User avatar
No.22693
Haze
Senior Tester
29 days ago
edited on: 29 days ago
Keep in mind any memory access code in the driver is a performance critical path, because the high frequency CPU does a lot of fetches, so if you've added guards in the critical path it will heavily impact performance.