Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08526 Misc. Critical (emulator) Always Dec 1, 2022, 23:56 Dec 1, 2022, 23:56
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Open OS Linux (64-bit)
Status [?] Acknowledged Driver
Version 0.250 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 08526: agat7: AddressSanitizer: heap-buffer-overflow with a9fdchle in slot
Description
==16778==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6270000421d4 at pc 0x7fa4b5df3772 bp 0x7ffffba07180 sp 0x7ffffba07178
READ of size 2 at 0x6270000421d4 thread T0
    #0 0x7fa4b5df3771 in a2bus_agat840k_hle_device::timer_wait_tick(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/bus/a2bus/agat840k_hle.cpp:237:10
    #1 0x7fa4ca8d7914 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #2 0x7fa4ca8d7914 in device_scheduler::execute_timers() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:951:5
    #3 0x7fa4ca8d2858 in device_scheduler::timeslice() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:505:2
    #4 0x7fa4ca76f0c7 in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:329:17
    #5 0x7fa4c26358ff in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #6 0x7fa4c39eeb16 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
    #7 0x7fa4c39f265f 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
    #8 0x7fa4c263a6df 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
    #9 0x7fa4caa64d9b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #10 0x7fa47d207189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #11 0x7fa47d207244 in __libc_start_main csu/../csu/libc-start.c:381:3
    #12 0x7fa4a4107540 in _start (/mnt/s/GitHub/mame/mame+0x25023540) (BuildId: 76865a226e2d969a)

0x6270000421d4 is located 0 bytes to the right of 12500-byte region [0x62700003f100,0x6270000421d4)
allocated by thread T0 here:
    #0 0x7fa4a41c52ed in operator new[](unsigned long) (/mnt/s/GitHub/mame/mame+0x250e12ed) (BuildId: 76865a226e2d969a)
    #1 0x7fa4b5df4779 in make_unique<unsigned short[]> /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:1080:30
    #2 0x7fa4b5df4779 in a2bus_agat840k_hle_device::device_reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/bus/a2bus/agat840k_hle.cpp:165:10
    #3 0x7fa4c3d5db0f in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:348:2
    #4 0x7fa4c3d5de85 in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:352:9
    #5 0x7fa4c3d5de85 in device_t::reset() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:352:9
    #6 0x7fa4ca76d474 in running_machine::reset_all_devices() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:1040:16
    #7 0x7fa4ca773849 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #8 0x7fa4ca773849 in running_machine::call_notifiers(machine_notification) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:849:3
    #9 0x7fa4ca76cee8 in running_machine::soft_reset(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:956:2
    #10 0x7fa4ca76ef7f in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:309:3
    #11 0x7fa4c26358ff in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #12 0x7fa4c39eeb16 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
    #13 0x7fa4c39f265f 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
    #14 0x7fa4c263a6df 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
    #15 0x7fa4caa64d9b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #16 0x7fa47d207189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

SUMMARY: AddressSanitizer: heap-buffer-overflow /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/bus/a2bus/agat840k_hle.cpp:237:10 in a2bus_agat840k_hle_device::timer_wait_tick(int)
Shadow bytes around the buggy address:
  0x0c4e800003e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4e800003f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4e80000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4e80000410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4e80000420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c4e80000430: 00 00 00 00 00 00 00 00 00 00[04]fa fa fa fa fa
  0x0c4e80000440: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4e80000450: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4e80000460: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4e80000470: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4e80000480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
Steps To Reproduce agat7 -sl2 a9fdchle
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems agat7
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
0
There are no notes attached to this issue.