Warzone2100 / warzone2100

Command the forces of The Project in a battle to rebuild the world after mankind has been nearly destroyed by nuclear missiles. A 100% free and open source real-time strategy game for Windows, macOS, Linux, BSD+
https://wz2100.net
GNU General Public License v2.0
3.16k stars 524 forks source link

CTD when Resuming Game from Music Manager #1912

Open Lupus-Mechanicus opened 3 years ago

Lupus-Mechanicus commented 3 years ago

Currently on 4.1.0-beta1, Linux - Ubuntu 20.04.2 Focal LTS

This was a very odd one to discover. :thinking: Totally wasn't thinking of writing another Bug Report, but here we are.

To reproduce this bug, do the following things.

  1. Open the game.
  2. Start the Campaign [the choice is yours, I tried with Alpha].
  3. Pause with ESC. Go to Options - Music Manager.
  4. Press Resume Game.
  5. Watch how your game commits seppuku live.

Here's an attached dump file: warzone2100.gdmp-maNdv4.txt

KJeff01 commented 3 years ago

Huh. Looks like keybinding context code is being executed when it shouldn't (for a menu option).

past-due commented 3 years ago

I've opened a PR that should prevent the crash (#1913), however the ultimate cause of the issue is that ContextManager::popState() is getting called twice (by two different parts of the code) when clicking the "Resume Game" button from the in-game Music Manager. That still could benefit from some re-thinking / re-factoring.

thiagorb commented 3 years ago

Is this already fixed? Should we close the issue? @Lupus-Mechanicus