Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor Segfault while clicking around during loading #6398

Open
bunnybot opened this issue Mar 5, 2024 · 0 comments
Open

Editor Segfault while clicking around during loading #6398

bunnybot opened this issue Mar 5, 2024 · 0 comments
Labels
bug Something isn't working crashes or hangs Assert failures, sigsegv, crashes, Widelands hangs, … editor Editor-specific features non-reproducable Intermittent bugs that occur only when you least expect them saveloading & compatibility Map/Game saving or loading, compatibility with older versions

Comments

@bunnybot
Copy link

bunnybot commented Mar 5, 2024

NordfrieseMirrored from Codeberg
Created on Tue Mar 05 19:18:50 CET 2024 by Benedikt Straub (Nordfriese)


Describe the bug
Non-reproducible segfault when clicking around in the editor wildly while a map is loading.

Found while I tried to reproduce #6391 in a debugger – not sure if they might be related or not.

To reproduce
Load a map in the editor and click around a lot while it's loading.
I think the fact that I moved the load game window to the side matters, so that behind the ProgressWindow some clicks landed on the map and some (double?-)clicks landed inside the load map window.

Crash log

Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x0000555555db2786 in Widelands::Field::get_height (this=0x9b08) at .../src/logic/field.h:109
109			return height;
(gdb) bt
<#>0  0x0000555555db2786 in Widelands::Field::get_height() const (this=0x9b08) at .../src/logic/field.h:109
#1  0x00005555577708b7 in MapviewPixelFunctions::calc_node_and_triangle(Widelands::Map const&, unsigned int, unsigned int) (map=..., x=499, y=112)
    at .../src/wui/mapviewpixelfunctions.cc:112
#2  0x000055555775ad55 in MapView::track_sel(Vector2<int> const&) (this=0x529000e794e8, p=...) at .../src/wui/mapview.cc:689
#3  0x0000555557758f3a in MapView::handle_mousemove(unsigned char, int, int, int, int) (this=0x529000e794e8, state=0 '\000', x=499, y=112, xdiff=5, ydiff=1)
    at .../src/wui/mapview.cc:563
#4  0x00005555564c073e in UI::Panel::do_mousemove(unsigned char, int, int, int, int) (this=0x529000e794e8, state=0 '\000', x=499, y=112, xdiff=5, ydiff=1)
    at .../src/ui_basic/panel.cc:1399
#5  0x00005555564c065e in UI::Panel::do_mousemove(unsigned char, int, int, int, int) (this=0x529000e79200, state=0 '\000', x=499, y=112, xdiff=5, ydiff=1)
    at .../src/ui_basic/panel.cc:1394
#6  0x00005555564c1ef1 in UI::Panel::ui_mousemove(unsigned char, int, int, int, int) (state=0 '\000', x=499, y=112, xdiff=5, ydiff=1) at .../src/ui_basic/panel.cc:1631
#7  0x0000555555c5d8d9 in WLApplication::handle_input(InputCallback const*)
    (this=0x555558a2f460 <WLApplication::get(int, char const**)::the_singleton>, cb=0x555558696a40 <UI::Panel::do_redraw_now(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::input_callback>) at .../src/wlapplication.cc:1062
#8  0x00005555564b65c1 in UI::Panel::do_redraw_now(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x516000fba380, handle_input=true, message="")
    at .../src/ui_basic/panel.cc:270
#9  0x00005555564dd26c in UI::ProgressWindow::step(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    (this=0x516000fba380, description="Lade Volk »Wille Lüü«: Arbeiders (4/6)") at .../src/ui_basic/progresswindow.cc:212
#10 0x0000555556120ba7 in Widelands::EditorGameBase::step_loader_ui(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
    (this=0x7ffff171c420, text="Lade Volk »Wille Lüü«: Arbeiders (4/6)") at .../src/logic/editor_game_base.cc:364
#11 0x000055555611ca81 in operator()(UI::NoteLoadingMessage const&) const (__closure=0x50400101eed8, note=...) at .../src/logic/editor_game_base.cc:74
#12 0x0000555556126e1d in std::__invoke_impl<void, Widelands::EditorGameBase::EditorGameBase(LuaInterface*)::<lambda(const UI::NoteLoadingMessage&)>&, const UI::NoteLoadingMessage&>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#13 0x0000555556126c95 in std::__invoke_r<void, Widelands::EditorGameBase::EditorGameBase(LuaInterface*)::<lambda(const UI::NoteLoadingMessage&)>&, const UI::NoteLoadingMessage&>(struct {...} &) (__fn=...)
    at /usr/include/c++/13/bits/invoke.h:111
#14 0x0000555556126ac3 in std::_Function_handler<void(const UI::NoteLoadingMessage&), Widelands::EditorGameBase::EditorGameBase(LuaInterface*)::<lambda(const UI::NoteLoadingMessage&)> >::_M_invoke(const std::_Any_data &, const UI::NoteLoadingMessage &) (__functor=..., __args<#>0=...) at /usr/include/c++/13/bits/std_function.h:290
#15 0x0000555555c9b787 in std::function<void (UI::NoteLoadingMessage const&)>::operator()(UI::NoteLoadingMessage const&) const (this=0x50400101eed8, __args<#>0=...) at /usr/include/c++/13/bits/std_function.h:591
#16 0x0000555555c8d646 in Notifications::NotificationsManager::publish<UI::NoteLoadingMessage>(UI::NoteLoadingMessage const&)
    (this=0x555558c13580 <Notifications::NotificationsManager::get()::instance>, message=...) at .../src/notifications/notifications_impl.h:76
#17 0x0000555555c82778 in Notifications::publish<UI::NoteLoadingMessage>(UI::NoteLoadingMessage const&) (message=...) at .../src/notifications/notifications.h:50
#18 0x0000555556e0a188 in operator()(std::string const&, int) const (__closure=0x7ffff18fa370, str="Arbeiders", i=4) at .../src/logic/map_objects/tribes/tribe_descr.cc:158
#19 0x0000555556e0be4a in Widelands::TribeDescr::TribeDescr(Widelands::TribeBasicInfo const&, Widelands::Descriptions&, LuaTable const&, LuaTable const*)
    (this=0x51b001362980, info=..., descriptions=..., table=..., scenario_table=0x0) at .../src/logic/map_objects/tribes/tribe_descr.cc:180
#20 0x0000555556bf0b9b in Widelands::Descriptions::add_tribe(LuaTable const&) (this=0x51000059da40, table=...) at .../src/logic/map_objects/descriptions.cc:521
#21 0x00005555574e664e in LuaRoot::LuaDescriptions::new_tribe(lua_State*) (this=0x502002a838b0, L=0x51b00124da88) at .../src/scripting/lua_root.cc:702
#22 0x00005555574f76cd in method_dispatch<LuaRoot::LuaDescriptions, LuaRoot::LuaDescriptions>(lua_State*) (L=0x51b00124da88) at .../src/scripting/luna_impl.h:176
#23 0x000055555787ef3a in luaD_precall (L=0x51b00124da88, func=0x51e0002acca0, nresults=0) at .../src/third_party/eris/ldo.c:434
#24 0x000055555789b0ab in luaV_execute (L=0x51b00124da88) at .../src/third_party/eris/lvm.c:1134
#25 0x000055555787f2c3 in luaD_call (L=0x51b00124da88, func=0x51a00055b090, nResults=1) at .../src/third_party/eris/ldo.c:499
#26 0x000055555787f321 in luaD_callnoyield (L=0x51b00124da88, func=0x51a00055b090, nResults=1) at .../src/third_party/eris/ldo.c:509
#27 0x0000555557876197 in f_call (L=0x51b00124da88, ud=0x7fffffff4f70) at .../src/third_party/eris/lapi.c:942
#28 0x000055555787e313 in luaD_rawrunprotected (L=0x51b00124da88, f=0x555557876162 <f_call>, ud=0x7fffffff4f70) at .../src/third_party/eris/ldo.c:142
#29 0x000055555787faf3 in luaD_pcall (L=0x51b00124da88, func=0x555557876162 <f_call>, u=0x7fffffff4f70, old_top=16, ef=0) at .../src/third_party/eris/ldo.c:729
#30 0x000055555787625f in lua_pcallk (L=0x51b00124da88, nargs=0, nresults=1, errfunc=0, ctx=0, k=0x0) at .../src/third_party/eris/lapi.c:968
#31 0x00005555570356c6 in (anonymous namespace)::run_string_as_script(lua_State*, std::string const&, std::string const&)
    (L=0x51b00124da88, identifier="tribes/initialization/barbarians/units.lua", content="descriptions = wl.Descriptions() -- TODO(matthiakl): only for savegame compatibility with 1.0, do not use.\n\nimage_dirname = path.dirname(__file__) .. \"images/\"\n\npush_textdomain(\"tribes_encyclopedia\")\n"...) at .../src/scripting/run_script.cc:66
#32 0x0000555557035e67 in run_script(lua_State*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, FileSystem*)
    (L=0x51b00124da88, path="tribes/initialization/barbarians/units.lua", fs=0x507000003890) at .../src/scripting/run_script.cc:108
#33 0x00005555573c91da in (anonymous namespace)::run_script_maybe_from_map(lua_State*, std::string const&) (L=0x51b00124da88, path="tribes/initialization/barbarians/units.lua")
    at .../src/scripting/logic.cc:62
#34 0x00005555573c96b7 in LuaEditorInterface::run_script(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
--Type <RET> for more, q to quit, c to continue without paging--c
    (this=0x5030006b2840, script="tribes/initialization/barbarians/units.lua") at .../src/scripting/logic.cc:83
#35 0x0000555557795a42 in Widelands::DescriptionManager::load_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    (this=0x512002e7b0c0, description_name="barbarians") at .../src/logic/map_objects/description_manager.cc:273
#36 0x0000555556bf1321 in Widelands::Descriptions::load_tribe(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x51000059da40, tribename="barbarians")
    at .../src/logic/map_objects/descriptions.cc:548
#37 0x00005555561edc1d in Widelands::PlayersManager::add_player(unsigned char, unsigned char, RGBColor const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char)
    (this=0x511000307400, player_number=2 '\002', initialization_index=0 '\000', pc=..., tribe="barbarians", name="Kartk", team=0 '\000') at .../src/logic/playersmanager.cc:78
#38 0x000055555611f314 in Widelands::EditorGameBase::add_player(unsigned char, unsigned char, RGBColor const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char)
    (this=0x7ffff171c420, player_number=2 '\002', initialization_index=0 '\000', pc=..., tribe="barbarians", name="Kartk", team=0 '\000') at .../src/logic/editor_game_base.cc:237
#39 0x0000555555d3230b in EditorInteractive::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x529000e79200, filename="maps/Islands_at_War.wmf")
    at .../src/editor/editorinteractive.cc:557
#40 0x0000555555e595cc in MainMenuLoadMap::clicked_ok() (this=0x528000000100) at .../src/editor/ui_menus/main_menu_load_map.cc:67
#41 0x0000555555e5873d in operator()(unsigned int) const (__closure=0x5060002ebd58) at .../src/editor/ui_menus/main_menu_load_map.cc:38
#42 0x0000555555e5b9a8 in std::__invoke_impl<void, MainMenuLoadMap::MainMenuLoadMap(EditorInteractive&, UI::UniqueWindow::Registry&)::<lambda(unsigned int)>&, unsigned int>(std::__invoke_other, struct {...} &)
    (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#43 0x0000555555e5b2b7 in std::__invoke_r<void, MainMenuLoadMap::MainMenuLoadMap(EditorInteractive&, UI::UniqueWindow::Registry&)::<lambda(unsigned int)>&, unsigned int>(struct {...} &) (__fn=...)
    at /usr/include/c++/13/bits/invoke.h:111
#44 0x0000555555e5ac64 in std::_Function_handler<void(unsigned int), MainMenuLoadMap::MainMenuLoadMap(EditorInteractive&, UI::UniqueWindow::Registry&)::<lambda(unsigned int)> >::_M_invoke(const std::_Any_data &, unsigned int &&) (__functor=..., __args<#>0=@0x7ffff11ff8a0: 8) at /usr/include/c++/13/bits/std_function.h:290
#45 0x0000555555ed3f07 in std::function<void (unsigned int)>::operator()(unsigned int) const (this=0x5060002ebd58, __args<#>0=8) at /usr/include/c++/13/bits/std_function.h:591
#46 0x00005555561981a6 in Notifications::Signal<unsigned int>::operator()(unsigned int) const (this=0x528000000bc8, args<#>0=8) at .../src/notifications/signal.h:62
#47 0x00005555565066dc in UI::Table<void*>::handle_mousepress(unsigned char, int, int) (this=0x528000000970, btn=1 '\001', y=190) at .../src/ui_basic/table.cc:547
#48 0x00005555564bfaf7 in UI::Panel::do_mousepress(unsigned char, int, int) (this=0x528000000970, btn=1 '\001', x=78, y=190) at .../src/ui_basic/panel.cc:1338
#49 0x00005555564bfa24 in UI::Panel::do_mousepress(unsigned char, int, int) (this=0x528000000768, btn=1 '\001', x=78, y=218) at .../src/ui_basic/panel.cc:1333
#50 0x00005555564bfa24 in UI::Panel::do_mousepress(unsigned char, int, int) (this=0x528000000560, btn=1 '\001', x=78, y=218) at .../src/ui_basic/panel.cc:1333
#51 0x00005555564bfa24 in UI::Panel::do_mousepress(unsigned char, int, int) (this=0x528000000358, btn=1 '\001', x=78, y=218) at .../src/ui_basic/panel.cc:1333
#52 0x00005555564bfa24 in UI::Panel::do_mousepress(unsigned char, int, int) (this=0x528000000100, btn=1 '\001', x=82, y=222) at .../src/ui_basic/panel.cc:1333
#53 0x00005555564bfa24 in UI::Panel::do_mousepress(unsigned char, int, int) (this=0x529000e79200, btn=1 '\001', x=364, y=340) at .../src/ui_basic/panel.cc:1333
#54 0x00005555564c1b5e in UI::Panel::ui_mousepress(unsigned char, int, int) (button=1 '\001', x=364, y=340) at .../src/ui_basic/panel.cc:1587
#55 0x0000555555c5e58c in WLApplication::handle_mousebutton(SDL_Event&, InputCallback const*)
    (this=0x555558a2f460 <WLApplication::get(int, char const**)::the_singleton>, ev=..., cb=0x555558696a40 <UI::Panel::do_redraw_now(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::input_callback>) at .../src/wlapplication.cc:1136
#56 0x0000555555c5d58a in WLApplication::handle_input(InputCallback const*)
    (this=0x555558a2f460 <WLApplication::get(int, char const**)::the_singleton>, cb=0x555558696a40 <UI::Panel::do_redraw_now(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::input_callback>) at .../src/wlapplication.cc:1050
#57 0x00005555564b65c1 in UI::Panel::do_redraw_now(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x529000e79200, handle_input=true, message="")
    at .../src/ui_basic/panel.cc:270
#58 0x00005555564b77d6 in UI::Panel::do_run() (this=0x529000e79200) at .../src/ui_basic/panel.cc:433
#59 0x0000555555c85ca2 in UI::Panel::run<UI::Panel::Returncodes>() (this=0x529000e79200) at .../src/ui_basic/panel.h:150
#60 0x0000555555d3ad13 in EditorInteractive::do_run_editor(EditorInteractive::Init, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (init=EditorInteractive::Init::kDefault, filename="", script_to_run="") at .../src/editor/editorinteractive.cc:1222
#61 0x0000555555d395f1 in EditorInteractive::run_editor(UI::Panel*, EditorInteractive::Init, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (error_message_parent=0x7ffff1a0a480, init=EditorInteractive::Init::kDefault, filename="", script_to_run="")
    at .../src/editor/editorinteractive.cc:1128
#62 0x0000555555c595f8 in WLApplication::run() (this=0x555558a2f460 <WLApplication::get(int, char const**)::the_singleton>) at .../src/wlapplication.cc:825
#63 0x0000555555c4a81d in main(int, char**) (argc=2, argv=0x7fffffffdde8) at .../src/main.cc:113
(gdb) 

...

(gdb) p map.fields_
$1 = std::unique_ptr<Widelands::Field []> = {get() = 0x0}

Version:

  • OS: Debian Unstable
  • Widelands Version: 1.2~git26565 (5f59e70@HEAD) Debug
  • Enabled Add-Ons: UI plugins test

Additional context
Possible solution might be to not handle input while a progress window is open

@bunnybot bunnybot added bug Something isn't working crashes or hangs Assert failures, sigsegv, crashes, Widelands hangs, … saveloading & compatibility Map/Game saving or loading, compatibility with older versions editor Editor-specific features non-reproducable Intermittent bugs that occur only when you least expect them labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crashes or hangs Assert failures, sigsegv, crashes, Widelands hangs, … editor Editor-specific features non-reproducable Intermittent bugs that occur only when you least expect them saveloading & compatibility Map/Game saving or loading, compatibility with older versions
Projects
None yet
Development

No branches or pull requests

1 participant