Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06816 Interface Minor Always Jan 2, 2018, 18:18 Jan 7, 2018, 01:04
Tester Firewave View Status Public Platform
Assigned To Firewave Resolution Fixed OS
Status [?] Resolved Driver
Version 0.193 Fixed in Version 0.194 Build
Fixed in Git Commit Github Pull Request #
Summary 06816: AddressSanitizer: alloc-dealloc-mismatch when closing dipswitch menu
Description
==2099==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x631007ecc800
    #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 0x9142e43 in ui::menu::~menu() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/menu.cpp:264:3
    #2 0x91e167d in ~menu_settings /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/inputmap.cpp:633:1
    #3 0x91e167d in ~menu_settings_dip_switches /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/inputmap.cpp:459
    #4 0x91e167d in ui::menu_settings_dip_switches::~menu_settings_dip_switches() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/inputmap.cpp:458
    #5 0x9141eda in operator() /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:76:2
    #6 0x9141eda in reset /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:344
    #7 0x9141eda in operator= /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:251
    #8 0x9141eda in clear_free_list /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/menu.cpp:165
    #9 0x9141eda in ui::menu::exit(running_machine&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/menu.cpp:210
    #10 0xe6a3ca0 in operator() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/delegate.h:544:11
    #11 0xe6a3ca0 in call_notifiers /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:885
    #12 0xe6a3ca0 in running_machine::run(bool) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:416
    #13 0x8cd10e0 in mame_machine_manager::execute() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:236:19
    #14 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
    #15 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
    #16 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
    #17 0x8acddf2 in main /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:216:9
    #18 0x7f59840c382f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291
    #19 0x1431838 in _start (/mnt/mame/mame64+0x1431838)

0x631007ecc800 is located 0 bytes inside of 65560-byte region [0x631007ecc800,0x631007edc818)
allocated by thread T0 here:
    #0 0x14fd8a2 in operator new[](unsigned long) /opt/media/clang_nightly/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_new_delete.cc:95:3
    #1 0x9145e09 in global_alloc_array_clear<unsigned char> /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/lib/util/corealloc.h:55:20
    #2 0x9145e09 in ui::menu::m_pool_alloc(unsigned long) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/menu.cpp:484
    #3 0x91e33a6 in ui::menu_settings::populate(float&, float&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/inputmap.cpp:605:32
    #4 0x914e24a in do_handle /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/menu.cpp:1197:3
    #5 0x914e24a in ui::menu::ui_handler(render_container&, mame_ui_manager&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/menu.cpp:1221
    #6 0x8da4155 in __call<unsigned int, render_container &, 0, 1> /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/functional:1073:11
    #7 0x8da4155 in operator()<render_container &, unsigned int> /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/functional:1131
    #8 0x8da4155 in std::_Function_handler<unsigned int (render_container&), std::_Bind<unsigned int (*(std::_Placeholder<1>, std::reference_wrapper<mame_ui_manager>))(render_container&, mame_ui_manager&)> >::_M_invoke(std::_Any_data const&, render_container&) /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/functional:1856
    #9 0x8d92475 in operator() /usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/functional:2267:14
    #10 0x8d92475 in mame_ui_manager::update_and_render(render_container&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/ui/ui.cpp:414
    #11 0x8cd3cb9 in emulator_info::draw_user_interface(running_machine&) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:347:41
    #12 0xe833354 in video_manager::frame_update(bool) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/video.cpp:220:2
    #13 0xe7aa719 in screen_device::vblank_begin() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:1524:21
    #14 0xe7a9c7c in screen_device::device_timer(emu_timer&, unsigned int, int, void*) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/screen.cpp:997:4
    #15 0xe795168 in timer_expired /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/device.h:520:83
    #16 0xe795168 in device_scheduler::execute_timers() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:906
    #17 0xe78ea0f in device_scheduler::timeslice() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/schedule.cpp:530:2
    #18 0xe6a324b in running_machine::run(bool) /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/emu/machine.cpp:357:17
    #19 0x8cd10e0 in mame_machine_manager::execute() /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/frontend/mame/mame.cpp:236:19
    #20 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
    #21 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
    #22 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
    #23 0x8acddf2 in main /mnt/mame/build/projects/sdl/mame/gmake-linux-clang/../../../../../src/osd/sdl/sdlmain.cpp:216:9
    #24 0x7f59840c382f in __libc_start_main /build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:291

SUMMARY: AddressSanitizer: alloc-dealloc-mismatch /opt/media/clang_nightly/llvm/utils/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_new_delete.cc:137:3 in operator delete(void*)
Steps To Reproduce - go to the "Dip Switches" menu
- leave the menu
Additional Information
Github Commit
Flags
Regression Version
Affected Sets / Systems
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
3
User avatar
No.14610
Firewave
Senior Tester
Jan 3, 2018, 16:42
Also happens with the "General Input -> User Interface" menu.
User avatar
No.14625
Firewave
Senior Tester
Jan 6, 2018, 02:52
Can be reproduced on Windows with DrMemory

Error #1: INVALID HEAP ARGUMENT: allocated with operator new[], freed with operator delete
# 0 replace_operator_delete_nothrow                                           [d:\drmemory_package\common\alloc_replace.c:2974]
# 1 ui::menu::~menu                                                           [../../../../../src/mame/mame.cpp:23]
# 2 ui::menu_settings_dip_switches::~menu_settings_dip_switches               [../../../../../src/mame/mame.cpp:23]
# 3 ui::menu::ui_handler                                                      [../../../../../src/mame/mame.cpp:23]
# 4 mame_ui_manager::update_and_render                                        [../../../../../src/mame/mame.cpp:23]
# 5 video_manager::frame_update                                               [../../../../../src/mame/mame.cpp:23]
# 6 screen_device::vblank_begin                                               [../../../../../src/mame/mame.cpp:23]
# 7 screen_device::device_timer                                               [../../../../../src/mame/mame.cpp:23]
# 8 device_scheduler::timeslice                                               [../../../../../src/mame/mame.cpp:23]
# 9 running_machine::run                                                      [../../../../../src/mame/mame.cpp:23]
#10 mame_machine_manager::execute                                             [../../../../../src/mame/mame.cpp:23]
#11 cli_frontend::start_execution                                             [../../../../../src/mame/mame.cpp:23]
#12 cli_frontend::execute                                                     [../../../../../src/mame/mame.cpp:23]
#13 emulator_info::start_frontend                                             [../../../../../src/mame/mame.cpp:23]
#14 main                                                                      [C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:374]
User avatar
No.14632
Firewave
Senior Tester
Jan 7, 2018, 01:04
Fixed in https://github.com/mamedev/mame/commit/4f0852d0d0e172c1e9d796bb80e6a43932d89314