Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
05867 Misc. Critical (emulator) Always Mar 5, 2015, 17:48 Nov 5, 2022, 09:14
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Fixed OS Linux
Status [?] Resolved Driver
Version 0.159 Fixed in Version Build Debug
Fixed in Git Commit Github Pull Request #
Summary 05867: opengolf, opengolf2: AddressSanitizer: heap-use-after-free
Description
==23535==ERROR: AddressSanitizer: heap-use-after-free on address 0x7fcdfb9628c0 at pc 0x00000292df95 bp 0x7fff5469a990 sp 0x7fff5469a988
READ of size 4 at 0x7fcdfb9628c0 thread T0
    #0 0x292df94 in konamigx_state::type1_roz_r2(address_space&, unsigned int, unsigned int) /home/notroot/trunk/src/mame/drivers/konamigx.c:740:2
    #1 0x80aafe3 in delegate_base<unsigned int, address_space&, unsigned int, unsigned int, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam>::operator()(address_space&, unsigned int, unsigned int) const /home/notroot/trunk/src/lib/util/delegate.h:652:76
    #2 0x80aafe3 in handler_entry_read::read32(address_space&, unsigned int, unsigned int) const /home/notroot/trunk/src/emu/memory.c:360
    #3 0x80aafe3 in address_space_specific<unsigned int, (endianness_t)1, true>::read_native(unsigned int, unsigned int) /home/notroot/trunk/src/emu/memory.c:1071
    #4 0x80a9792 in unsigned char address_space_specific<unsigned int, (endianness_t)1, true>::read_direct<unsigned char, true>(unsigned int, unsigned char) /home/notroot/trunk/src/emu/memory.c:1167:12
    #5 0x80a9792 in address_space_specific<unsigned int, (endianness_t)1, true>::read_byte(unsigned int) /home/notroot/trunk/src/emu/memory.c:1412
    #6 0x68bd525 in delegate_base<unsigned char, unsigned int, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam, _noparam>::operator()(unsigned int) const /home/notroot/trunk/src/lib/util/delegate.h:650:52
    #7 0x68bd525 in m68ki_read_8_fc(m68000_base_device*, unsigned int, unsigned int) /home/notroot/trunk/src/emu/cpu/m68000/m68kcpu.h:800
    #8 0x68bd525 in OPER_AY_IX_8(m68000_base_device*) /home/notroot/trunk/src/emu/cpu/m68000/m68kcpu.h:1012
    #9 0x68bd525 in m68000_base_device_ops::m68k_op_move_8_d_ix(m68000_base_device*) /home/notroot/trunk/obj/sdl64d/emu/cpu/m68000/m68kops.c:16075
    #10 0x67dace6 in m68000_base_device::cpu_execute() /home/notroot/trunk/src/emu/cpu/m68000/m68kcpu.c:861:5
    #11 0x67c48ff in m68000_base_device::execute_run() /home/notroot/trunk/src/emu/cpu/m68000/m68kcpu.c:2493:2
    #12 0x67c48ff in non-virtual thunk to m68000_base_device::execute_run() /home/notroot/trunk/src/emu/cpu/m68000/m68kcpu.c:2494
    #13 0x813206a in device_execute_interface::run() /home/notroot/trunk/src/emu/diexec.h:191:15
    #14 0x813206a in device_scheduler::timeslice() /home/notroot/trunk/src/emu/schedule.c:476
    #15 0x804fe48 in running_machine::run(bool) /home/notroot/trunk/src/emu/machine.c:397:5
    #16 0x8047ee6 in machine_manager::execute() /home/notroot/trunk/src/emu/mame.c:222:11
    #17 0x7e79dbc in cli_frontend::execute(int, char**) /home/notroot/trunk/src/emu/clifront.c:220:15
    #18 0x575d9bb in main /home/notroot/trunk/src/osd/sdl/sdlmain.c:322:9
    #19 0x7fce0e4a3ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
    #20 0x116cdfc in _start (/home/notroot/trunk/mame64d+0x116cdfc)

0x7fcdfb9628c0 is located 1016000 bytes inside of 1048576-byte region [0x7fcdfb86a800,0x7fcdfb96a800)
freed by thread T0 here:
    #0 0x114f50b in free /home/ben/development/llvm/3.5/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:30:3
    #1 0x8b42548 in osd_free(void*) /home/notroot/trunk/src/osd/modules/lib/osdlib_unix.c:103:2
    #2 0x841a766 in free_file_line(void*, char const*, int, bool) /home/notroot/trunk/src/lib/util/corealloc.c:178:2
    #3 0x8120404 in operator delete[](void*) /home/notroot/trunk/src/lib/util/corealloc.h:66:87
    #4 0x8120404 in dynamic_array<unsigned char>::reset() /home/notroot/trunk/src/lib/util/coretmpl.h:93
    #5 0x8120404 in dynamic_array<unsigned char>::~dynamic_array() /home/notroot/trunk/src/lib/util/coretmpl.h:78
    #6 0x8120404 in read_rom_data(romload_private*, rom_entry const*, rom_entry const*) /home/notroot/trunk/src/emu/romload.c:870
    #7 0x8120404 in process_rom_entries(romload_private*, char const*, rom_entry const*, rom_entry const*, device_t*, bool) /home/notroot/trunk/src/emu/romload.c:992
    #8 0x8124fb0 in process_region_list(romload_private*) /home/notroot/trunk/src/emu/romload.c:1498:5
    #9 0x8124fb0 in rom_init(running_machine&) /home/notroot/trunk/src/emu/romload.c:1565
    #10 0x804c2e0 in running_machine::start() /home/notroot/trunk/src/emu/machine.c:255:2
    #11 0x804fb73 in running_machine::run(bool) /home/notroot/trunk/src/emu/machine.c:351:3
    #12 0x8047ee6 in machine_manager::execute() /home/notroot/trunk/src/emu/mame.c:222:11
    #13 0x7e79dbc in cli_frontend::execute(int, char**) /home/notroot/trunk/src/emu/clifront.c:220:15
    #14 0x575d9bb in main /home/notroot/trunk/src/osd/sdl/sdlmain.c:322:9
    #15 0x7fce0e4a3ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

previously allocated by thread T0 here:
    #0 0x114f78b in __interceptor_malloc /home/ben/development/llvm/3.5/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3
    #1 0x8b42538 in osd_malloc_array(unsigned long) /home/notroot/trunk/src/osd/modules/lib/osdlib_unix.c:89:9
    #2 0x8419fca in malloc_file_line(unsigned long, char const*, int, bool, bool, bool) /home/notroot/trunk/src/lib/util/corealloc.c:112:25
    #3 0x811e5cc in operator new[](unsigned long, char const*, int) /home/notroot/trunk/src/lib/util/corealloc.h:72:125
    #4 0x811e5cc in dynamic_array<unsigned char>::expand_internal(int) /home/notroot/trunk/src/lib/util/coretmpl.h:115
    #5 0x811e5cc in dynamic_array<unsigned char>::dynamic_array(int, int) /home/notroot/trunk/src/lib/util/coretmpl.h:77
    #6 0x811e5cc in read_rom_data(romload_private*, rom_entry const*, rom_entry const*) /home/notroot/trunk/src/emu/romload.c:795
    #7 0x811e5cc in process_rom_entries(romload_private*, char const*, rom_entry const*, rom_entry const*, device_t*, bool) /home/notroot/trunk/src/emu/romload.c:992
    #8 0x8124fb0 in process_region_list(romload_private*) /home/notroot/trunk/src/emu/romload.c:1498:5
    #9 0x8124fb0 in rom_init(running_machine&) /home/notroot/trunk/src/emu/romload.c:1565
    #10 0x804c2e0 in running_machine::start() /home/notroot/trunk/src/emu/machine.c:255:2
    #11 0x804fb73 in running_machine::run(bool) /home/notroot/trunk/src/emu/machine.c:351:3
    #12 0x8047ee6 in machine_manager::execute() /home/notroot/trunk/src/emu/mame.c:222:11
    #13 0x7e79dbc in cli_frontend::execute(int, char**) /home/notroot/trunk/src/emu/clifront.c:220:15
    #14 0x575d9bb in main /home/notroot/trunk/src/osd/sdl/sdlmain.c:322:9
    #15 0x7fce0e4a3ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

SUMMARY: AddressSanitizer: heap-use-after-free /home/notroot/trunk/src/mame/drivers/konamigx.c:740 konamigx_state::type1_roz_r2(address_space&, unsigned int, unsigned int)
Shadow bytes around the buggy address:
  0x0ffa3f7244c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0ffa3f7244d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0ffa3f7244e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0ffa3f7244f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0ffa3f724500: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0ffa3f724510: fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd fd
  0x0ffa3f724520: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0ffa3f724530: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0ffa3f724540: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0ffa3f724550: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0ffa3f724560: 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  ASan internal:           fe
Steps To Reproduce
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems opengolf, opengolf2
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
1
User avatar
No.20737
Firewave
Senior Tester
Nov 5, 2022, 09:14
These sets are marked MNW.

No ASAN error reported with 0.249 on Linux.