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

incorrect map_data crashes leads to crash with SIGABRT #4395

Open
sevu opened this issue Sep 28, 2019 · 2 comments

Comments

@sevu
Copy link
Member

commented Sep 28, 2019

Giving incorrect data to map_data, e.g. a longer string, crashes the game when entering MP lobby. Gracefully aborting with an error message would be better.

20190928 18:39:15 error config: map could not be loaded: Condition 'size <= 4' failed at src/terrain/translation.cpp:710 in function 'string_to_layer_'.
wesnoth: /usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:697: boost::dynamic_bitset<Block, Allocator>::~dynamic_bitset() [with Block = long unsigned int; Allocator = std::allocator<long unsigned int>]: Assertion `m_check_invariants()' failed.
(gdb) bt
#0  0x00007f8c61f57755 in raise () at /usr/lib/libc.so.6
#1  0x00007f8c61f42851 in abort () at /usr/lib/libc.so.6
#2  0x00007f8c61f42727 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3  0x00007f8c61f50026 in  () at /usr/lib/libc.so.6
#4  0x000055ee6892ac17 in boost::dynamic_bitset<unsigned long, std::allocator<unsigned long> >::~dynamic_bitset() [clone .lto_priv.0] ()
#5  0x000055ee68473077 in void gui2::dialogs::mp_create_game::on_filter_change<gui2::slider>(gui2::window&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) ()
#6  0x000055ee684736b8 in gui2::dialogs::mp_create_game::display_games_of_type(gui2::window&, ng::level::TYPE, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#7  0x000055ee68478542 in gui2::dialogs::mp_create_game::pre_show(gui2::window&) ()
#8  0x000055ee681599fa in gui2::dialogs::modal_dialog::show(unsigned int) [clone .constprop.0] ()
#9  0x000055ee684d1646 in (anonymous namespace)::enter_create_mode(std::shared_ptr<(anonymous namespace)::mp_workflow_helper>) [clone .lto_priv.0] ()
#10 0x000055ee68865b48 in game_launcher::play_multiplayer(game_launcher::mp_selection) ()
#11 0x000055ee688ec488 in do_gameloop(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&) ()
#12 0x000055ee6813ed69 in main ()

(current 1.14 checkout)

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2019

the error points to an out-of-bound access here

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2019

and its also clear why:
game_list only contains games with can_launch_game while indices returned by get_filtered_level_indices are probably indicies to the complete list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.