AddressSanitizer error on the attempt to save
I get this every time when trying to click Save
in the main menu on 3fbed432:
==8331==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fd2748ec551 at pc 0x55ea7ca38608 bp 0x7ffef65ea9d0 sp 0x7ffef65ea190
READ of size 9 at 0x7fd2748ec551 thread T0
#0 0x55ea7ca38607 in memmove (/home/elsid/dev/openmw/build/clang/asan/openmw+0xadf607)
#1 0x7fd28638b967 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*, unsigned long) (/usr/lib/libc++.so.1+0x57967)
#2 0x7fd286b7e83f in MyGUI::UString::assign(char const*, unsigned long) /home/elsid/dev/mygui/MyGUIEngine/src/MyGUI_UString.cpp:985:7
#3 0x7fd286b7e83f in MyGUI::UString::UString(char const*, unsigned long) /home/elsid/dev/mygui/MyGUIEngine/src/MyGUI_UString.cpp:572:3
#4 0x55ea7d081002 in MWGui::toUString(std::__1::basic_string_view<char, std::__1::char_traits<char> >) /home/elsid/dev/openmw/apps/openmw/mwgui/ustring.hpp:11:16
#5 0x55ea7d081002 in MWGui::SaveGameDialog::onOpen() /home/elsid/dev/openmw/apps/openmw/mwgui/savegamedialog.cpp:198:120
#6 0x55ea7ce00d00 in MWGui::WindowBase::setVisible(bool) /home/elsid/dev/openmw/apps/openmw/mwgui/windowbase.cpp
#7 0x55ea7cf91ef5 in MWGui::MainMenu::onButtonClicked(MyGUI::Widget*) /home/elsid/dev/openmw/apps/openmw/mwgui/mainmenu.cpp
#8 0x55ea7cf96f4e in MyGUI::delegates::DelegateFunction<MyGUI::Widget*>* MyGUI::newDelegate<MWGui::MainMenu, MyGUI::Widget*>(MWGui::MainMenu*, void (MWGui::MainMenu::*)(MyGUI::Widget*))::'lambda'(MyGUI::Widget*&&)::operator()(MyGUI::Widget*&&) const /home/elsid/dev/mygui/build/clang/release/install/include/MYGUI/MyGUI_Delegate.h:109:32
#9 0x55ea7cf96f4e in decltype(static_cast<MWGui::MainMenu>(fp)(static_cast<MyGUI::Widget*>(fp0))) std::__1::__invoke<MyGUI::delegates::DelegateFunction<MyGUI::Widget*>* MyGUI::newDelegate<MWGui::MainMenu, MyGUI::Widget*>(MWGui::MainMenu*, void (MWGui::MainMenu::*)(MyGUI::Widget*))::'lambda'(MyGUI::Widget*&&)&, MyGUI::Widget*>(MWGui::MainMenu&&, MyGUI::Widget*&&) /usr/bin/../include/c++/v1/type_traits:3640:23
#10 0x55ea7cf96f4e in void std::__1::__invoke_void_return_wrapper<void, true>::__call<MyGUI::delegates::DelegateFunction<MyGUI::Widget*>* MyGUI::newDelegate<MWGui::MainMenu, MyGUI::Widget*>(MWGui::MainMenu*, void (MWGui::MainMenu::*)(MyGUI::Widget*))::'lambda'(MyGUI::Widget*&&)&, MyGUI::Widget*>(MyGUI::delegates::DelegateFunction<MyGUI::Widget*>* MyGUI::newDelegate<MWGui::MainMenu, MyGUI::Widget*>(MWGui::MainMenu*, void (MWGui::MainMenu::*)(MyGUI::Widget*))::'lambda'(MyGUI::Widget*&&)&, MyGUI::Widget*&&) /usr/bin/../include/c++/v1/__functional/invoke.h:61:9
#11 0x55ea7cf96f4e in std::__1::__function::__alloc_func<MyGUI::delegates::DelegateFunction<MyGUI::Widget*>* MyGUI::newDelegate<MWGui::MainMenu, MyGUI::Widget*>(MWGui::MainMenu*, void (MWGui::MainMenu::*)(MyGUI::Widget*))::'lambda'(MyGUI::Widget*&&), std::__1::allocator<MyGUI::delegates::DelegateFunction<MyGUI::Widget*>* MyGUI::newDelegate<MWGui::MainMenu, MyGUI::Widget*>(MWGui::MainMenu*, void (MWGui::MainMenu::*)(MyGUI::Widget*))::'lambda'(MyGUI::Widget*&&)>, void (MyGUI::Widget*)>::operator()(MyGUI::Widget*&&) /usr/bin/../include/c++/v1/__functional/function.h:180:16
#12 0x55ea7cf96f4e in std::__1::__function::__func<MyGUI::delegates::DelegateFunction<MyGUI::Widget*>* MyGUI::newDelegate<MWGui::MainMenu, MyGUI::Widget*>(MWGui::MainMenu*, void (MWGui::MainMenu::*)(MyGUI::Widget*))::'lambda'(MyGUI::Widget*&&), std::__1::allocator<MyGUI::delegates::DelegateFunction<MyGUI::Widget*>* MyGUI::newDelegate<MWGui::MainMenu, MyGUI::Widget*>(MWGui::MainMenu*, void (MWGui::MainMenu::*)(MyGUI::Widget*))::'lambda'(MyGUI::Widget*&&)>, void (MyGUI::Widget*)>::operator()(MyGUI::Widget*&&) /usr/bin/../include/c++/v1/__functional/function.h:354:12
#13 0x7fd286b96cd8 in std::__1::__function::__value_func<void (MyGUI::Widget*)>::operator()(MyGUI::Widget*&&) const /usr/bin/../include/c++/v1/__functional/function.h:507:16
#14 0x7fd286b96cd8 in std::__1::function<void (MyGUI::Widget*)>::operator()(MyGUI::Widget*) const /usr/bin/../include/c++/v1/__functional/function.h:1184:12
#15 0x7fd286b96cd8 in MyGUI::delegates::DelegateFunction<MyGUI::Widget*>::invoke(MyGUI::Widget*) /home/elsid/dev/mygui/MyGUIEngine/include/MyGUI_Delegate.h:73:4
#16 0x7fd286b96cd8 in MyGUI::delegates::MultiDelegate<MyGUI::Widget*>::operator()(MyGUI::Widget*) const /home/elsid/dev/mygui/MyGUIEngine/include/MyGUI_Delegate.h:281:15
#17 0x7fd286b96cd8 in MyGUI::WidgetInput::_riseMouseButtonClick() /home/elsid/dev/mygui/MyGUIEngine/src/MyGUI_WidgetInput.cpp:87:3
#18 0x7fd286ae225b in MyGUI::InputManager::injectMouseRelease(int, int, MyGUI::MouseButton) /home/elsid/dev/mygui/MyGUIEngine/src/MyGUI_InputManager.cpp:333:27
#19 0x55ea7ccecffa in MWInput::MouseManager::mouseReleased(SDL_MouseButtonEvent const&, unsigned char) /home/elsid/dev/openmw/apps/openmw/mwinput/mousemanager.cpp:127:58
#20 0x55ea7ecd5dd6 in SDLUtil::InputWrapper::capture(bool) /home/elsid/dev/openmw/components/sdlutil/sdlinputwrapper.cpp
#21 0x55ea7cce9d39 in MWInput::InputManager::update(float, bool, bool) /home/elsid/dev/openmw/apps/openmw/mwinput/inputmanagerimp.cpp:69:24
#22 0x55ea7e271d6d in OMW::Engine::frame(float) /home/elsid/dev/openmw/apps/openmw/engine.cpp:312:28
#23 0x55ea7e286fa5 in OMW::Engine::go() /home/elsid/dev/openmw/apps/openmw/engine.cpp:1116:14
#24 0x55ea7e26defa in runApplication(int, char**) /home/elsid/dev/openmw/apps/openmw/main.cpp:228:17
#25 0x55ea7eb03ee8 in wrapApplication(int (*)(int, char**), int, char**, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) /home/elsid/dev/openmw/components/debug/debugging.cpp:333:19
#26 0x55ea7e26e1ff in main /home/elsid/dev/openmw/apps/openmw/main.cpp:240:12
#27 0x7fd283a3c28f (/usr/lib/libc.so.6+0x2328f) (BuildId: 26c81e7e05ebaf40bac3523b7d76be0cd71fad82)
#28 0x7fd283a3c349 in __libc_start_main (/usr/lib/libc.so.6+0x23349) (BuildId: 26c81e7e05ebaf40bac3523b7d76be0cd71fad82)
#29 0x55ea7c9aeed4 in _start /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115
Address 0x7fd2748ec551 is located in stack of thread T0 at offset 1361 in frame
#0 0x55ea7d07fe3f in MWGui::SaveGameDialog::onOpen() /home/elsid/dev/openmw/apps/openmw/mwgui/savegamedialog.cpp:146
This frame has 22 object(s):
[32, 56) 'ref.tmp.i556'
[96, 120) 'ref.tmp.i'
[160, 208) 'ref.tmp' (line 149)
[240, 288) 'ref.tmp15' (line 157)
[320, 344) 'directory' (line 170)
[384, 664) 'title' (line 179)
[736, 936) 'ref.tmp81' (line 180)
[1008, 1208) 'ref.tmp91' (line 185)
[1280, 1480) 'ref.tmp100' (line 186) <== Memory access at offset 1361 is inside this variable
[1552, 1752) 'ref.tmp125' (line 190)
[1824, 2024) 'ref.tmp154' (line 198)
[2096, 2144) 'ref.tmp164' (line 198)
[2176, 2224) 'ref.tmp165' (line 198)
[2256, 2304) 'ref.tmp183' (line 200)
[2336, 2384) 'ref.tmp187' (line 200)
[2416, 2440) 'ref.tmp188' (line 200)
[2480, 2488) 'agg.tmp195'
[2512, 2536) 'ref.tmp214' (line 202)
[2576, 2600) 'ref.tmp216' (line 202)
[2640, 2664) 'ref.tmp218' (line 202)
[2704, 2728) 'ref.tmp220' (line 202)
[2768, 2792) 'ref.tmp321' (line 214)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-use-after-scope (/home/elsid/dev/openmw/build/clang/asan/openmw+0xadf607) in memmove
Shadow bytes around the buggy address:
0x0fface915850: 00 00 00 f2 f2 f2 f2 f2 f2 f2 f2 f2 f8 f8 f8 f8
0x0fface915860: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
0x0fface915870: f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f2 f2 f2 f2 f8 f8
0x0fface915880: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
0x0fface915890: f8 f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f2 f2 f2 f2
=>0x0fface9158a0: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8[f8]f8 f8 f8 f8 f8
0x0fface9158b0: f8 f8 f8 f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f2 f2
0x0fface9158c0: f2 f2 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
0x0fface9158d0: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2
0x0fface9158e0: f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00
0x0fface9158f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2
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
==8331==ABORTING