Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08525 Crash/Freeze Critical (emulator) Always Dec 1, 2022, 15:43 Dec 2, 2022, 14:34
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Open OS Linux (64-bit)
Status [?] Driver
Version 0.250 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 08525: some apple/apple2.cpp sets: Segmentation fault with mcms2 in slot
Description
==13768==ERROR: AddressSanitizer: SEGV on unknown address 0x03e8000035c8 (pc 0x7fa09f03accc bp 0x7fa09b9d7970 sp 0x7fa09b9d7860 T0)
==13768==The signal is caused by a READ memory access.
    #0 0x7fa09f03accc in __pthread_kill_implementation nptl/./nptl/pthread_kill.c:44:76
    #1 0x7fa09efebef1 in raise signal/../sysdeps/posix/raise.c:26:13
    #2 0x7fa0a0dcf3c5  (/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0+0x13f3c5) (BuildId: 418f97e44d04d8ab9d3828e3cc45a8743439ecf7)
    #3 0x7fa09efebf8f  (/lib/x86_64-linux-gnu/libc.so.6+0x3bf8f) (BuildId: b1c6521cd0ab872b70c21377654e966ea9d438c9)
    #4 0x7fa0d7c3a82a in a2bus_mcms1_device::get_engine() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/bus/a2bus/a2mcms.cpp:122
    #5 0x7fa0d7c3aed9 in a2bus_mcms2_device::device_reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/bus/a2bus/a2mcms.cpp:166:22
    #6 0x7fa0e5b2fb0f in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:348:2
    #7 0x7fa0e5b2fe85 in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:352:9
    #8 0x7fa0e5b2fe85 in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:352:9
    #9 0x7fa0ec53f474 in running_machine::reset_all_devices() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:1040:16
    #10 0x7fa0ec545849 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #11 0x7fa0ec545849 in running_machine::call_notifiers(machine_notification) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:849:3
    #12 0x7fa0ec53eee8 in running_machine::soft_reset(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:956:2
    #13 0x7fa0ec540f7f in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:309:3
    #14 0x7fa0e44078ff in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #15 0x7fa0e57c0b16 in 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&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:275:22
    #16 0x7fa0e57c465f in 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> > > >&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:291:3
    #17 0x7fa0e440c6df in 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> > > >&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:454:18
    #18 0x7fa0ec836d9b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #19 0x7fa09efd7189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #20 0x7fa09efd7244 in __libc_start_main csu/../csu/libc-start.c:381:3
    #21 0x7fa0c5ed9540 in _start (/mnt/s/GitHub/mame/mame+0x25023540) (BuildId: 76865a226e2d969a)

This is probably caused by
../../../../../src/devices/bus/a2bus/a2mcms.cpp:166:22: runtime error: member call on null pointer of type 'a2bus_mcms1_device'
    #0 0x7fd8eedf7096 in a2bus_mcms2_device::device_reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/bus/a2bus/a2mcms.cpp:166:22
    #1 0x7fd8fccebb0f in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:348:2
    #2 0x7fd8fccebe85 in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:352:9
    #3 0x7fd8fccebe85 in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:352:9
    #4 0x7fd9036fb474 in running_machine::reset_all_devices() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:1040:16
    #5 0x7fd903701849 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #6 0x7fd903701849 in running_machine::call_notifiers(machine_notification) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:849:3
    #7 0x7fd9036faee8 in running_machine::soft_reset(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:956:2
    #8 0x7fd9036fcf7f in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:309:3
    #9 0x7fd8fb5c38ff in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #10 0x7fd8fc97cb16 in 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&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:275:22
    #11 0x7fd8fc98065f in 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> > > >&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:291:3
    #12 0x7fd8fb5c86df in 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> > > >&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:454:18
    #13 0x7fd9039f2d9b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #14 0x7fd8b6197189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #15 0x7fd8b6197244 in __libc_start_main csu/../csu/libc-start.c:381:3
    #16 0x7fd8dd095540 in _start (/mnt/s/GitHub/mame/mame+0x25023540) (BuildId: 76865a226e2d969a)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../../../src/devices/bus/a2bus/a2mcms.cpp:166:22 in
Steps To Reproduce ace1000 -sl2 mcms2
Additional Information Affected sets (among others):
ace1000
ace100
albert
am100
am64
apple2
Github Commit
Flags
Regression Version
Affected Sets / Systems some apple/apple2.cpp sets
Attached Files
 
Relationships
Notes
2
User avatar
No.20888
Tafoid
Administrator
Dec 2, 2022, 10:19
As I understand this unique device, it requires 2 slots to be filled, both mcms1 and mcms2 (-sl1 mcms1 -sl2 mcms2). The only warning MAME is able to give is to make sure mcms2 is in a slot that is 2 or greater. If you attempt to mount the second device and not the first is where the problems happen.
User avatar
No.20891
Firewave
Senior Tester
Dec 2, 2022, 14:34
I was afraid it was something like that.

Still it simply looks up a device and uses it without checking (in this case a NULL pointer). It could check the device and fatalerror instead.