Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08478 Misc. Critical (emulator) Always Nov 4, 2022, 13:04 Nov 4, 2022, 18:34
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To hap Resolution Fixed OS Linux (64-bit)
Status [?] Resolved Driver
Version 0.249 Fixed in Version 0.250 Build 64-bit
Fixed in Git Commit 256894f Github Pull Request #
Summary 08478: all atari/atarifb.cpp sets: AddressSanitizer: heap-buffer-overflow
Description
=================================================================
==4763==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6190000b9e40 at pc 0x7ffa16b8ed45 bp 0x7ffff4beb450 sp 0x7ffff4beb448
READ of size 1 at 0x6190000b9e40 thread T0
    #0 0x7ffa16b8ed44 in atarifb_state::field_get_tile_info(tilemap_t&, tile_data&, unsigned int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/atari/atarifb_v.cpp:79:13
    #1 0x7ffa383bba0d in util::detail::delegate_base<delegate_late_bind, void, tilemap_t&, tile_data&, unsigned int>::operator()(tilemap_t&, tile_data&, unsigned int) const /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #2 0x7ffa383b2fad in tilemap_t::tile_update(unsigned int, unsigned int, unsigned int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/tilemap.cpp:804:2
    #3 0x7ffa383b29a0 in tilemap_t::pixmap_update() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/tilemap.cpp:785:5
    #4 0x7ffa16274537 in tilemap_t::pixmap() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/tilemap.h:456:27
    #5 0x7ffa16b90648 in atarifb_state::draw_playfield_and_alpha(bitmap_ind16&, rectangle const&, int, int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/atari/atarifb_v.cpp:143:44
    #6 0x7ffa16b9219e in atarifb_state::screen_update_abaseb(screen_device&, bitmap_ind16&, rectangle const&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/atari/atarifb_v.cpp:197:2
    #7 0x7ffa3834c56d in util::detail::delegate_base<delegate_late_bind, unsigned int, screen_device&, bitmap_ind16&, rectangle const&>::operator()(screen_device&, bitmap_ind16&, rectangle const&) const /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #8 0x7ffa3833c386 in screen_device::update_partial(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:1215:41
    #9 0x7ffa16b7a799 in atarifb_state::interrupt(timer_device&, int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/atari/atarifb.cpp:118:12
    #10 0x7ffa2e15d77f in util::detail::delegate_base<delegate_late_bind, void, timer_device&, int>::operator()(timer_device&, int) const /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #11 0x7ffa2e15993a in timer_device::scanline_tick(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/machine/timer.cpp:175:4
    #12 0x7ffa3831b304 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #13 0x7ffa3831b304 in device_scheduler::execute_timers() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:951:5
    #14 0x7ffa38316858 in device_scheduler::timeslice() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:505:2
    #15 0x7ffa381ae4a7 in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:329:17
    #16 0x7ffa3b314f7f in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #17 0x7ffa3b5098d6 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
    #18 0x7ffa3b50d41f 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
    #19 0x7ffa3b319d5f 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
    #20 0x7ffa384f058b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #21 0x7ff9f69f9209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #22 0x7ff9f69f92bb in __libc_start_main csu/../csu/libc-start.c:389:3
    #23 0x7ffa15c7a260 in _start (/mnt/s/GitHub/mame/mame+0x1d397260) (BuildId: 603d3d1c300651feb2a8e3ac6e9cb58d3f85e77b)

0x6190000b9e40 is located 0 bytes to the right of 960-byte region [0x6190000b9a80,0x6190000b9e40)
allocated by thread T0 here:
    #0 0x7ffa15cfd0ae in __interceptor_malloc (/mnt/s/GitHub/mame/mame+0x1d41a0ae) (BuildId: 603d3d1c300651feb2a8e3ac6e9cb58d3f85e77b)
    #1 0x7ffa31b443f9 in memory_manager::allocate_memory(device_t&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned char, unsigned long) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem.cpp:312:46
    #2 0x7ffa31b45255 in memory_manager::share_alloc(device_t&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned char, unsigned long, util::endianness) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem.cpp:378:14
    #3 0x7ffa31b8f3be in address_space::prepare_map_generic(address_map&, bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem_aspace.cpp:809:23
    #4 0x7ffa31b91d62 in address_space::prepare_map() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem_aspace.cpp:896:2
    #5 0x7ffa31b6b3b7 in device_memory_interface::prepare_maps() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/dimemory.h:102:84
    #6 0x7ffa31b43b1a in memory_manager::initialize() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem.cpp:293:11
    #7 0x7ffa381aabf5 in running_machine::start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:183:11
    #8 0x7ffa381ae0dc in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:281:3
    #9 0x7ffa3b314f7f in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #10 0x7ffa3b5098d6 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 0x7ffa3b50d41f 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 0x7ffa3b319d5f 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 0x7ffa384f058b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #14 0x7ff9f69f9209 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/atari/atarifb_v.cpp:79:13 in atarifb_state::field_get_tile_info(tilemap_t&, tile_data&, unsigned int)
Shadow bytes around the buggy address:
  0x0c328000f370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c328000f380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c328000f390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c328000f3a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c328000f3b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c328000f3c0: 00 00 00 00 00 00 00 00[fa]fa fa fa fa fa fa fa
  0x0c328000f3d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c328000f3e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c328000f3f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c328000f400: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c328000f410: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
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
==4763==ABORTING
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems all atari/atarifb.cpp sets
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
2
User avatar
No.20707
hap
Developer
Nov 4, 2022, 18:20
maybe fixed here: https://github.com/mamedev/mame/commit/256894fdb43385cc56551b3c4956b60b72958349
User avatar
No.20709
Firewave
Senior Tester
Nov 4, 2022, 18:34
Cherry-picked and fix confirmed.