Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08492 Misc. Critical (emulator) Always Nov 4, 2022, 13:59 Dec 4, 2022, 19:56
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.251 Build 64-bit
Fixed in Git Commit 210c795 Github Pull Request #
Summary 08492: combatscb: AddressSanitizer: heap-buffer-overflow
Description
==10899==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6250000b68fb at pc 0x7fc8e7424a60 bp 0x7ffff115c660 sp 0x7ffff115c658
READ of size 1 at 0x6250000b68fb thread T0
    #0 0x7fc8e7424a5f in combatscb_state::draw_sprites(bitmap_ind16&, rectangle const&, unsigned char const*, int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/konami/combatsc_v.cpp:500:24
    #1 0x7fc8e7425973 in combatscb_state::screen_update(screen_device&, bitmap_ind16&, rectangle const&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/mame/konami/combatsc_v.cpp:541:3
    #2 0x7fc903c0c56d 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
    #3 0x7fc903bfc386 in screen_device::update_partial(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:1215:41
    #4 0x7fc903cf9bc9 in video_manager::finish_screen_updates() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/video.cpp:622:10
    #5 0x7fc903cf89cb in video_manager::frame_update(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/video.cpp:215:44
    #6 0x7fc903bf27c8 in screen_device::vblank_begin(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:1646:21
    #7 0x7fc903bdb304 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #8 0x7fc903bdb304 in device_scheduler::execute_timers() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:951:5
    #9 0x7fc903bd6858 in device_scheduler::timeslice() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:505:2
    #10 0x7fc903a6e4a7 in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:329:17
    #11 0x7fc906bd4f7f in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #12 0x7fc906dc98d6 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 0x7fc906dcd41f 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 0x7fc906bd9d5f 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 0x7fc903db058b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #16 0x7fc8c22b9209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #17 0x7fc8c22b92bb in __libc_start_main csu/../csu/libc-start.c:389:3
    #18 0x7fc8e153a260 in _start (/mnt/s/GitHub/mame/mame+0x1d397260) (BuildId: 603d3d1c300651feb2a8e3ac6e9cb58d3f85e77b)

0x6250000b68fb is located 5 bytes to the left of 8192-byte region [0x6250000b6900,0x6250000b8900)
allocated by thread T0 here:
    #0 0x7fc8e15bd0ae in __interceptor_malloc (/mnt/s/GitHub/mame/mame+0x1d41a0ae) (BuildId: 603d3d1c300651feb2a8e3ac6e9cb58d3f85e77b)
    #1 0x7fc8fd4043f9 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 0x7fc8fd405255 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 0x7fc903149579 in memory_view::memory_view_entry::prepare_map_generic(address_map&, bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem_mview.cpp:524:23
    #4 0x7fc9031f915b in memory_view_entry_specific<1, 0, 0>::populate_from_map(address_map*) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem_mview.cpp:610:2
    #5 0x7fc903159702 in memory_view::make_subdispatch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem_mview.cpp:789:6
    #6 0x7fc8fd5eb47e in address_space_specific<1, 0, 0, (util::endianness)1>::install_view(unsigned int, unsigned int, unsigned int, memory_view&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem_aspace.cpp:1033:7
    #7 0x7fc8fd40c57f in address_space_installer::populate_map_entry(address_map_entry const&, read_or_write) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem.cpp:861:5
    #8 0x7fc8fd45258f in address_space::populate_from_map(address_map*) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem_aspace.cpp:941:3
    #9 0x7fc8fd42b5b9 in device_memory_interface::populate_from_maps() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/dimemory.h:103:90
    #10 0x7fc8fd403c6a in memory_manager::initialize() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem.cpp:297:11
    #11 0x7fc903a6abf5 in running_machine::start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:183:11
    #12 0x7fc903a6e0dc in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:281:3
    #13 0x7fc906bd4f7f in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #14 0x7fc906dc98d6 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
    #15 0x7fc906dcd41f 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
    #16 0x7fc906bd9d5f 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
    #17 0x7fc903db058b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #18 0x7fc8c22b9209 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/konami/combatsc_v.cpp:500:24 in combatscb_state::draw_sprites(bitmap_ind16&, rectangle const&, unsigned char const*, int)
Shadow bytes around the buggy address:
  0x0c4a8000ecc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000ecd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000ece0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000ecf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000ed00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c4a8000ed10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa[fa]
  0x0c4a8000ed20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a8000ed30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a8000ed40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a8000ed50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a8000ed60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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 combatscb
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
1
User avatar
No.20912
hap
Developer
Dec 4, 2022, 15:20
probably fixed here: https://github.com/mamedev/mame/commit/210c79556b8c13d10f8b8946590d98cc0bced218
(ugly pointer math)