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

dependency system can cause crashes #4398

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

Comments

@sevu
Copy link
Member

commented Sep 28, 2019

The bug report below focuses only on getting the crash. Working test case:

Have the following situation in WML:

  • [era] with force_modification=xyz
  • [era] with ignores_scenario=abc
  • [scenario] with disallow_modification=xyz

Obviously, not all can be true at the same time. But by answering Wesnoth’s questions you can get this setup working:

  1. Select an other scenario, chose the desired era. You'll be asked to activate the modification, if it isn't the case already
  2. Switch to the desired scenario. It asks you to deactivate the modification. -> yes
  3. Followed by question from the era to activate it -> no
  4. Play. Exit wesnoth normally (not ctrl+c), so the config is saved

Getting the crash:

  1. Launch wesnoth and go to create a MP game. Wesnoth remembers your last selection form last game.
  2. While the loading screen is shown, the era asks to activate the modification -> no leads to crash

Bonus: Easy reproduction – because wesnoth died, it didn't write the config and you are asked the same next time.

I got a crash with the same error message without restarting wesnoth, while clicking around through scenarios, and denying / accepting different answers. So this issue is not specific to entering MP, it's merely a way to reproduce. This was at that time my stderr and backtrace:

wesnoth-1.14: src/gui/widgets/menu_button.cpp:203: void gui2::menu_button::set_selected(unsigned int, bool): Assertion `selected < values_.size()' failed.`
#0  0x00007f2c2ba98755 in raise () at /usr/lib/libc.so.6
#1  0x00007f2c2ba83851 in abort () at /usr/lib/libc.so.6
#2  0x00007f2c2ba83727 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3  0x00007f2c2ba91026 in  () at /usr/lib/libc.so.6
#4  0x000055da81dee2f5 in gui2::menu_button::set_selected(unsigned int, bool) ()
#5  0x000055da81937472 in gui2::dialogs::mp_create_game::sync_with_depcheck(gui2::window&) ()
#6  0x000055da819379b9 in gui2::dialogs::mp_create_game::on_era_select(gui2::window&) ()
#7  0x000055da81612af6 in bool gui2::event::fire_event<std::function<void (gui2::widget&, gui2::event::ui_event, bool&, bool&, void*)>, decltype(nullptr)>(gui2::event::ui_event, gui2::event::dispatcher*, gui2::widget*, decltype(nullptr)&&) [clone .constprop.0] ()
#8  0x000055da81dee2ad in gui2::menu_button::set_selected(unsigned int, bool) ()
#9  0x000055da8193ca00 in gui2::dialogs::mp_create_game::pre_show(gui2::window&) ()
#10 0x000055da8161e9fa in gui2::dialogs::modal_dialog::show(unsigned int) [clone .constprop.0] ()
#11 0x000055da81996646 in (anonymous namespace)::enter_create_mode(std::shared_ptr<(anonymous namespace)::mp_workflow_helper>) [clone .lto_priv.0] ()
#12 0x000055da81d2ab48 in game_launcher::play_multiplayer(game_launcher::mp_selection) ()
#13 0x000055da81db1488 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&) ()
#14 0x000055da81603d69 in main ()
@Wedge009

This comment has been minimized.

Copy link
Member

commented Oct 3, 2019

Which add-ons/scenarios are candidates for the set-up you have here?

@sevu

This comment has been minimized.

Copy link
Member Author

commented Oct 4, 2019

I added the three lines to the ANLEra add-on; to one of the included scenarios and the era.

@gfgtdf

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2019

maybe someone could explain again what 'ignores_scenario' does, odeally with a concreate usecase?

@sevu

This comment has been minimized.

Copy link
Member Author

commented Oct 4, 2019

That was supposed to mean ignore_incompatible_scenario.
From what I've seen, the options with "ignore_" in the name allow you to click away the popup with "no" without resetting the checkbox.

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