Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08483 Misc. Critical (emulator) Always Nov 4, 2022, 13:22 Nov 17, 2022, 21:05
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Open OS Linux (64-bit)
Status [?] Confirmed Driver
Version 0.249 Fixed in Version Build 32-bit
Fixed in Git Commit Github Pull Request #
Summary 08483: all amiga/arsystems.cpp and amiga/upscope.cpp sets: AddressSanitizer: heap-buffer-overflow
Description
==5857==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f1be10140dc at pc 0x7f1c1b09c7eb bp 0x7fffe5af6d90 sp 0x7fffe5af6d88
WRITE of size 4 at 0x7f1be10140dc thread T0
    #0 0x7f1c1b09c7ea in amiga_state::render_scanline(bitmap_rgb32&, int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/amiga/amiga_v.cpp:603:15
    #1 0x7f1c1b09cb80 in amiga_state::screen_update_amiga(screen_device&, bitmap_rgb32&, rectangle const&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/amiga/amiga_v.cpp:877:3
    #2 0x7f1c3229b7bd in util::detail::delegate_base<delegate_late_bind, unsigned int, screen_device&, bitmap_rgb32&, rectangle const&>::operator()(screen_device&, bitmap_rgb32&, rectangle const&) const /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #3 0x7f1c3d022201 in screen_device::update_partial(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:1216:41
    #4 0x7f1c1b062277 in amiga_state::scanline_callback(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/amiga/amiga_m.cpp:277:17
    #5 0x7f1c3d001304 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #6 0x7f1c3d001304 in device_scheduler::execute_timers() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:951:5
    #7 0x7f1c3cffc858 in device_scheduler::timeslice() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:505:2
    #8 0x7f1c3ce944a7 in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:329:17
    #9 0x7f1c3fffaf7f in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #10 0x7f1c401ef8d6 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 0x7f1c401f341f 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 0x7f1c3ffffd5f 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 0x7f1c3d1d658b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #14 0x7f1bfb6d9209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #15 0x7f1bfb6d92bb in __libc_start_main csu/../csu/libc-start.c:389:3
    #16 0x7f1c1a960260 in _start (/mnt/s/GitHub/mame/mame+0x1d397260) (BuildId: 603d3d1c300651feb2a8e3ac6e9cb58d3f85e77b)

0x7f1be10140dc is located 4 bytes to the right of 1911000-byte region [0x7f1be0e41800,0x7f1be10140d8)
allocated by thread T0 here:
    #0 0x7f1c1aa1e19d in operator new[](unsigned long, std::nothrow_t const&) (/mnt/s/GitHub/mame/mame+0x1d45519d) (BuildId: 603d3d1c300651feb2a8e3ac6e9cb58d3f85e77b)
    #1 0x7f1c3f2c5225 in bitmap_t::allocate(int, int, int, int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/bitmap.cpp:242:17
    #2 0x7f1c3d017d83 in screen_device::register_screen_bitmap(bitmap_t&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:1627:9
    #3 0x7f1c3d014060 in screen_device::device_start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:819:3
    #4 0x7f1c36670410 in device_t::start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:562:2
    #5 0x7f1c3ce932df in running_machine::start_all_devices() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:1013:13
    #6 0x7f1c3ce912b4 in running_machine::start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:211:2
    #7 0x7f1c3ce940dc in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:281:3
    #8 0x7f1c3fffaf7f in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #9 0x7f1c401ef8d6 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
    #10 0x7f1c401f341f 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
    #11 0x7f1c3ffffd5f 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
    #12 0x7f1c3d1d658b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #13 0x7f1bfb6d9209 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/mame/amiga/amiga_v.cpp:603:15 in amiga_state::render_scanline(bitmap_rgb32&, int)
Shadow bytes around the buggy address:
  0x0fe3fc1fa7c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe3fc1fa7d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe3fc1fa7e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe3fc1fa7f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe3fc1fa800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe3fc1fa810: 00 00 00 00 00 00 00 00 00 00 00[fa]fa fa fa fa
  0x0fe3fc1fa820: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe3fc1fa830: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe3fc1fa840: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe3fc1fa850: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe3fc1fa860: 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
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems all amiga/arsystems.cpp and amiga/upscope.cpp sets
Attached Files
 
Relationships
related to 08491Acknowledged  cndypuzl, haremchl, lasstixx, mgnumber, mgprem11: AddressSanitizer: heap-buffer-overflow 
Notes
3
User avatar
No.20791
Firewave
Senior Tester
Nov 10, 2022, 11:11
The code looks similar to amiga_state::aga_render_scanline() it might be the same issue as https://mametesters.org/view.php?id=8491.
User avatar
No.20827
Firewave
Senior Tester
Nov 15, 2022, 11:51
See also: https://github.com/mamedev/mame/issues/9936
User avatar
No.20841
Firewave
Senior Tester
Nov 17, 2022, 21:05
Confirmed since there's external reports of this crashing.