Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08491 Misc. Critical (emulator) Always Nov 4, 2022, 13:58 20 days ago
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Open OS Linux (64-bit)
Status [?] Acknowledged Driver
Version 0.249 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 08491: cndypuzl, haremchl, lasstixx, mgnumber, mgprem11: AddressSanitizer: heap-buffer-overflow
Description
==10717==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fadacd3cebc at pc 0x7fade70bc2d1 bp 0x7ffff55e2e00 sp 0x7ffff55e2df8
WRITE of size 4 at 0x7fadacd3cebc thread T0
    #0 0x7fade70bc2d0 in amiga_state::aga_render_scanline(bitmap_rgb32&, int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/amiga/amigaaga.cpp:628:15
    #1 0x7fade70bc5d0 in amiga_state::screen_update_amiga_aga(screen_device&, bitmap_rgb32&, rectangle const&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/amiga/amigaaga.cpp:954:3
    #2 0x7fadfe2a67bd 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 0x7fae0902d201 in screen_device::update_partial(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:1216:41
    #4 0x7fade706d277 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 0x7fae0900c304 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #6 0x7fae0900c304 in device_scheduler::execute_timers() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:951:5
    #7 0x7fae09007858 in device_scheduler::timeslice() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:505:2
    #8 0x7fae08e9f4a7 in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:329:17
    #9 0x7fae0c005f7f in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #10 0x7fae0c1fa8d6 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 0x7fae0c1fe41f 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 0x7fae0c00ad5f 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 0x7fae091e158b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #14 0x7fadc76e9209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #15 0x7fadc76e92bb in __libc_start_main csu/../csu/libc-start.c:389:3
    #16 0x7fade696b260 in _start (/mnt/s/GitHub/mame/mame+0x1d397260) (BuildId: 603d3d1c300651feb2a8e3ac6e9cb58d3f85e77b)

0x7fadacd3cebc is located 4 bytes to the right of 2275000-byte region [0x7fadacb11800,0x7fadacd3ceb8)
allocated by thread T0 here:
    #0 0x7fade6a2919d in operator new[](unsigned long, std::nothrow_t const&) (/mnt/s/GitHub/mame/mame+0x1d45519d) (BuildId: 603d3d1c300651feb2a8e3ac6e9cb58d3f85e77b)
    #1 0x7fae0b2d0225 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 0x7fae09022d83 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 0x7fae0901f060 in screen_device::device_start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:819:3
    #4 0x7fae0267b410 in device_t::start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.cpp:562:2
    #5 0x7fae08e9e2df in running_machine::start_all_devices() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:1013:13
    #6 0x7fae08e9c2b4 in running_machine::start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:211:2
    #7 0x7fae08e9f0dc in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:281:3
    #8 0x7fae0c005f7f in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #9 0x7fae0c1fa8d6 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 0x7fae0c1fe41f 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 0x7fae0c00ad5f 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 0x7fae091e158b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #13 0x7fadc76e9209 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/amigaaga.cpp:628:15 in amiga_state::aga_render_scanline(bitmap_rgb32&, int)
Shadow bytes around the buggy address:
  0x0ff63599f980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff63599f990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff63599f9a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff63599f9b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ff63599f9c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ff63599f9d0: 00 00 00 00 00 00 00[fa]fa fa fa fa fa fa fa fa
  0x0ff63599f9e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0ff63599f9f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0ff63599fa00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0ff63599fa10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0ff63599fa20: 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 cndypuzl, haremchl, lasstixx, mgnumber, mgprem11
Attached Files
 
Relationships
related to 08483Confirmed all amiga/arsystems.cpp and amiga/upscope.cpp sets: AddressSanitizer: heap-buffer-overflow 
Notes
1
User avatar
No.20792
Firewave
Senior Tester
27 days ago
The code looks similar to amiga_state::render_scanline() it might be the same issue as https://mametesters.org/view.php?id=8483.