Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08524 Misc. Critical (emulator) Always Dec 1, 2022, 15:38 Dec 1, 2022, 15:51
Tester Firewave View Status Public Platform MAME (Self-compiled)
Assigned To Resolution Open OS Linux (64-bit)
Status [?] Acknowledged Driver
Version 0.250 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 08524: some apple/apple2.cpp sets: AddressSanitizer: heap-buffer-overflow with booti in slot
Description
==13617==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6250000a4900 at pc 0x7fc9cf113253 bp 0x7fffe9f0f970 sp 0x7fffe9f0f968
READ of size 1 at 0x6250000a4900 thread T0
    #0 0x7fc9cf113252 in at28c64b_device::nvram_default() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/machine/at28c64b.cpp:102:39
    #1 0x7fc9cf11326f in non-virtual thunk to at28c64b_device::nvram_default() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/machine/at28c64b.cpp
    #2 0x7fc9da68ed91 in nvram_reset /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/dinvram.h:40:23
    #3 0x7fc9da68ed91 in running_machine::nvram_load() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:1143:10
    #4 0x7fc9da68cdee in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:293:3
    #5 0x7fc9d25538ff in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #6 0x7fc9d390cb16 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
    #7 0x7fc9d391065f 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
    #8 0x7fc9d25586df 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
    #9 0x7fc9da982d9b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #10 0x7fc98d127189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #11 0x7fc98d127244 in __libc_start_main csu/../csu/libc-start.c:381:3
    #12 0x7fc9b4025540 in _start (/mnt/s/GitHub/mame/mame+0x25023540) (BuildId: 76865a226e2d969a)

0x6250000a4900 is located 0 bytes to the right of 8192-byte region [0x6250000a2900,0x6250000a4900)
allocated by thread T0 here:
    #0 0x7fc9b40e31dd in operator new(unsigned long) (/mnt/s/GitHub/mame/mame+0x250e11dd) (BuildId: 76865a226e2d969a)
    #1 0x7fc9b4759a62 in allocate /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/new_allocator.h:137:27
    #2 0x7fc9b4759a62 in allocate /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/alloc_traits.h:464:20
    #3 0x7fc9b4759a62 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_allocate(unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:378:20
    #4 0x7fc9b47599c1 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_create_storage(unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:395:33
    #5 0x7fc9b4759923 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_base(unsigned long, std::allocator<unsigned char> const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:332:9
    #6 0x7fc9b47598a6 in std::vector<unsigned char, std::allocator<unsigned char> >::vector(unsigned long, std::allocator<unsigned char> const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:552:9
    #7 0x7fc9d3e41c02 in memory_region::memory_region(running_machine&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, unsigned char, util::endianness) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem.cpp:1040:3
    #8 0x7fc9d3e563b7 in std::__detail::_MakeUniq<memory_region>::__single_object std::make_unique<memory_region, running_machine&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&, unsigned char&, util::endianness&>(running_machine&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&, unsigned char&, util::endianness&) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:1065:34
    #9 0x7fc9d3e2f054 in memory_manager::region_alloc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, unsigned char, util::endianness) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/emumem.cpp:331:36
    #10 0x7fc9da7c2b76 in rom_load_manager::process_region_list() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/romload.cpp:1370:35
    #11 0x7fc9da7c4e9d in rom_load_manager::rom_load_manager(running_machine&) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/romload.cpp:1482:2
    #12 0x7fc9da6897dd in make_unique<rom_load_manager, running_machine &> /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:1065:34
    #13 0x7fc9da6897dd in running_machine::start() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:182:15
    #14 0x7fc9da68ccfc in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:281:3
    #15 0x7fc9d25538ff in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #16 0x7fc9d390cb16 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
    #17 0x7fc9d391065f 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
    #18 0x7fc9d25586df 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
    #19 0x7fc9da982d9b in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #20 0x7fc98d127189 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/devices/machine/at28c64b.cpp:102:39 in at28c64b_device::nvram_default()
Shadow bytes around the buggy address:
  0x0c4a8000c8d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a8000c8e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a8000c8f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a8000c900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c4a8000c910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c4a8000c920:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000c930: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000c940: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000c950: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000c960: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c4a8000c970: 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 ace1000 -sl1 booti
Additional Information Affected sets (among others):
ace1000
ace100
albert
am100
am64
apple2
Github Commit
Flags
Regression Version
Affected Sets / Systems some apple/apple2.cpp sets
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
0
There are no notes attached to this issue.