Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06834 Misc. Critical (emulator) Always Jan 8, 2018, 09:47 Nov 5, 2022, 08:59
Tester Firewave View Status Public Platform
Assigned To Resolution Open OS
Status [?] Acknowledged Driver
Version 0.193 Fixed in Version Build
Fixed in Git Commit Github Pull Request #
Summary MESS-specific 06834: supergb, supergb2: AddressSanitizer: heap-buffer-overflow with -cart 188in1
Description
==150863==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6290005135ad at pc 0x00000d403a66 bp 0x7ffebd373a00 sp 0x7ffebd3739f8
READ of size 1 at 0x6290005135ad thread T0
    #0 0xd403a65 in sgb_ppu_device::update_sprites() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1326:17
    #1 0xd40573c in sgb_ppu_device::update_scanline(unsigned int) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1581:5
    #2 0xd40e7b8 in dmg_ppu_device::update_state() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:2074:5
    #3 0xd40c44d in dmg_ppu_device::device_timer(emu_timer&, unsigned int, int, void*) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1928:2
    #4 0xe795168 in timer_expired /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.h:520:83
    #5 0xe795168 in device_scheduler::execute_timers() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:906
    #6 0xe78ea0f in device_scheduler::timeslice() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:530:2
    #7 0xe6a324b in running_machine::run(bool) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:357:17
    #8 0x8cd10e0 in mame_machine_manager::execute() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:236:19
    #9 0x8e1e0d3 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:257:22
    #10 0x8e20ee0 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:273:3
    #11 0x8cd3717 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:336:18
    #12 0x8acddf2 in main /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:216:9
    #13 0x7fe8d85a582f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291
    #14 0x1431838 in _start (/mnt/mame/mame64_as+0x1431838)

0x6290005135ad is located 717 bytes to the right of 16608-byte region [0x62900050f200,0x6290005132e0)
freed by thread T0 here:
    #0 0x14fe342 in operator delete(void*) /opt/media/clang_nightly/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_new_delete.cc:137:3
    #1 0xf288497 in operator() /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:76:2
    #2 0xf288497 in ~unique_ptr /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:236
    #3 0xf288497 in util::archive_file::open_zip(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::unique_ptr<util::archive_file, std::default_delete<util::archive_file> >&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/unzip.cpp:1468
    #4 0xe477f7c in emu_file::attempt_zipped() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/fileio.cpp:680:39
    #5 0xe4753f7 in emu_file::open_next() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/fileio.cpp:358:13
    #6 0xe475117 in emu_file::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/fileio.cpp:283:9
    #7 0xe6e7447 in render_target::load_layout_file(char const*, char const*) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/render.cpp:1865:39
    #8 0xe6d584e in render_target::load_layout_files(internal_layout const*, bool) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/render.cpp:1590:7
    #9 0xe6d49ad in render_target::render_target(render_manager&, internal_layout const*, unsigned int) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/render.cpp:970:2
    #10 0xe6ecc81 in render_manager::target_alloc(internal_layout const*, unsigned int) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/render.cpp:2831:31
    #11 0x8adcc71 in sdl_window_info::window_init() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/window.cpp:416:32
    #12 0x8ad0236 in sdl_osd_interface::video_init() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/video.cpp:79:12
    #13 0x8af970a in osd_common_t::init_subsystems() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/lib/osdobj_common.cpp:650:7
    #14 0x8acf161 in sdl_osd_interface::init(running_machine&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:500:16
    #15 0xe69f690 in running_machine::start() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:214:18
    #16 0xe6a2a41 in running_machine::run(bool) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:310:3
    #17 0x8cd10e0 in mame_machine_manager::execute() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:236:19
    #18 0x8e1e0d3 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:257:22
    #19 0x8e20ee0 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:273:3
    #20 0x8cd3717 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:336:18
    #21 0x8acddf2 in main /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:216:9
    #22 0x7fe8d85a582f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291

previously allocated by thread T0 here:
    #0 0x14fd722 in operator new(unsigned long) /opt/media/clang_nightly/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_new_delete.cc:92:3
    #1 0xf285303 in make_unique<util::(anonymous namespace)::zip_file_impl, const std::__cxx11::basic_string<char> &> /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:765:30
    #2 0xf285303 in util::archive_file::open_zip(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::unique_ptr<util::archive_file, std::default_delete<util::archive_file> >&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/unzip.cpp:1452
    #3 0xe477f7c in emu_file::attempt_zipped() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/fileio.cpp:680:39
    #4 0xe4753f7 in emu_file::open_next() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/fileio.cpp:358:13
    #5 0xe475117 in emu_file::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/fileio.cpp:283:9
    #6 0xe6e7447 in render_target::load_layout_file(char const*, char const*) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/render.cpp:1865:39
    #7 0xe6d584e in render_target::load_layout_files(internal_layout const*, bool) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/render.cpp:1590:7
    #8 0xe6d49ad in render_target::render_target(render_manager&, internal_layout const*, unsigned int) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/render.cpp:970:2
    #9 0xe6ecc81 in render_manager::target_alloc(internal_layout const*, unsigned int) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/render.cpp:2831:31
    #10 0x8adcc71 in sdl_window_info::window_init() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/window.cpp:416:32
    #11 0x8ad0236 in sdl_osd_interface::video_init() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/video.cpp:79:12
    #12 0x8af970a in osd_common_t::init_subsystems() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/modules/lib/osdobj_common.cpp:650:7
    #13 0x8acf161 in sdl_osd_interface::init(running_machine&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:500:16
    #14 0xe69f690 in running_machine::start() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:214:18
    #15 0xe6a2a41 in running_machine::run(bool) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:310:3
    #16 0x8cd10e0 in mame_machine_manager::execute() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:236:19
    #17 0x8e1e0d3 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:257:22
    #18 0x8e20ee0 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/clifront.cpp:273:3
    #19 0x8cd3717 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/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:336:18
    #20 0x8acddf2 in main /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:216:9
    #21 0x7fe8d85a582f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291

SUMMARY: AddressSanitizer: heap-buffer-overflow /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1326:17 in sgb_ppu_device::update_sprites()
Shadow bytes around the buggy address:
  0x0c528009a660: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c528009a670: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c528009a680: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c528009a690: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c528009a6a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c528009a6b0: fa fa fa fa fa[fa]fa fa fa fa fa fa fa fa fa fa
  0x0c528009a6c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c528009a6d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c528009a6e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c528009a6f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c528009a700: 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 supergb, supergb2
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
2
User avatar
No.14642
Firewave
Senior Tester
Jan 9, 2018, 22:08
uint16_t xindex = m_oam[oam_address + 1] - 8;

uint8_t pal = m_sgb_pal_map[(xindex < 0) ? 0 : (xindex >> 3)][((yindex - SGB_YOFFSET) >> 3)] << 2;
The < 0 check never works since it is unsigned - xindex also seems to underflow to 0xffff causing this access to be always out of bounds since m_sgb_pal_map[20][18].
User avatar
No.20730
Firewave
Senior Tester
Nov 5, 2022, 08:59
0.249 reports the following on Linux:
==1443==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6290004d75c5 at pc 0x7fe60ab02e20 bp 0x7ffffb1736c0 sp 0x7ffffb1736b8
READ of size 1 at 0x6290004d75c5 thread T0
    #0 0x7fe60ab02e1f in sgb_ppu_device::update_sprites() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1320:17
    #1 0x7fe60ab07482 in sgb_ppu_device::update_scanline(unsigned int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1575:5
    #2 0x7fe60ab18d08 in dmg_ppu_device::update_state() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:2068:5
    #3 0x7fe60aae8a14 in dmg_ppu_device::update_tick(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1922:2
    #4 0x7fe61398a6b4 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #5 0x7fe61398a6b4 in device_scheduler::execute_timers() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:951:5
    #6 0x7fe6139855f8 in device_scheduler::timeslice() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:505:2
    #7 0x7fe613822067 in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:329:17
    #8 0x7fe60b931caf in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #9 0x7fe60cce9026 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 0x7fe60ccecb6f 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 0x7fe60b936a8f 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 0x7fe613b180fb in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #13 0x7fe5c6859209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #14 0x7fe5c68592bb in __libc_start_main csu/../csu/libc-start.c:389:3
    #15 0x7fe5ed4a8120 in _start (/mnt/s/GitHub/mame/mame+0x24d60120) (BuildId: 7b7aeda5846ab501)

Address 0x6290004d75c5 is a wild pointer inside of access range of size 0x000000000001.
SUMMARY: AddressSanitizer: heap-buffer-overflow /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1320:17 in sgb_ppu_device::update_sprites()
Shadow bytes around the buggy address:
  0x0c5280092e60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c5280092e70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c5280092e80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c5280092e90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c5280092ea0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c5280092eb0: fa fa fa fa fa fa fa fa[fa]fa fa fa fa fa fa fa
  0x0c5280092ec0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c5280092ed0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c5280092ee0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c5280092ef0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c5280092f00: 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

Possibly caused by:
../../../../../src/devices/video/gb_lcd.cpp:1320:17: runtime error: index 8191 out of bounds for type 'uint8_t[20][18]' (aka 'unsigned char[20][18]')
    #0 0x7fe60ab027ac in sgb_ppu_device::update_sprites() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1320:17
    #1 0x7fe60ab07482 in sgb_ppu_device::update_scanline(unsigned int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1575:5
    #2 0x7fe60ab18d08 in dmg_ppu_device::update_state() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:2068:5
    #3 0x7fe60aae8a14 in dmg_ppu_device::update_tick(int) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/devices/video/gb_lcd.cpp:1922:2
    #4 0x7fe61398a6b4 in operator() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:765:11
    #5 0x7fe61398a6b4 in device_scheduler::execute_timers() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:951:5
    #6 0x7fe6139855f8 in device_scheduler::timeslice() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:505:2
    #7 0x7fe613822067 in running_machine::run(bool) /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:329:17
    #8 0x7fe60b931caf in mame_machine_manager::execute() /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:290:19
    #9 0x7fe60cce9026 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 0x7fe60ccecb6f 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 0x7fe60b936a8f 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 0x7fe613b180fb in main /mnt/s/GitHub/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:191:9
    #13 0x7fe5c6859209 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #14 0x7fe5c68592bb in __libc_start_main csu/../csu/libc-start.c:389:3
    #15 0x7fe5ed4a8120 in _start (/mnt/s/GitHub/mame/mame+0x24d60120) (BuildId: 7b7aeda5846ab501)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../../../src/devices/video/gb_lcd.cpp:1320:17 in