Closed DrissiReda closed 4 years ago
Can't replicate it yet, but it looks like this was introduced by #1154 . @MaanooAk Do you know what might cause this?
It is either ecab22b2c5f227c38540be50cefd71648c1d11b9, 59239da34e60e8a6830a80f40ad4bc21d26aa2e8 or d7c9b15e6c0859875cfeeafc06a51e5b95acbc35 according to the bisect.
I used the Age of Empires II with the Age of Conquerors extension installed on patch 1.0c if that helps
We had time to test this on Debian now and it seems to be a bug in a library delivered with Debian and Ubuntu 19.04. The bug persists when using clang
, although the stack trace is slightly more informative.
File ?, in openage::gui::ActionModeLink::get_selection_size() const+0x32 [0x7f75f3ddd452]
File ?, in openage::UnitSelection::get_units_count() const+0x1e [0x7f75f3c80d4e]
File ?, in std::unordered_map<unsigned long, openage::UnitReference, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, openage::UnitReference> > >::size() const+0x15 [0x7f75f3c82735]
File ?, in std::_Hashtable<unsigned long, std::pair<unsigned long const, openage::UnitReference>, std::allocator<std::pair<unsigned long const, openage::UnitReference> >, std::__detail::_Select1st, std::equal_to<unsigned long>, std::hash<unsigned long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::size() const+0xc [0x7f75f3c8274c]
File ?, in ? [0x7f75f304f840]
File ?, in ? [0x7f75f3e5f525]
File ?, in ? [0x7f75f3408901]
File ?, in ? [0x7f75f34088c6]
File ?, in openage::error::terminate_handler()+0x371 [0x7f75f3e5f431]
The cause of the segfault is a call to units.size()
in selection.h
.
Somehow .size()
and other calls like .empty()
fail. I don't know the exact root cause here, but it seems to only affect Debian and Ubuntu 19.04 (and maybe 18.10). Ubuntu 19.10 and 18.04 LTS don't create these issues.
For a solution, we would have to test which library is the issue. Otherwise, you unfortunately have to wait until the distros upgrade their repos to a newer version of the libraries.
Do you have the correct versions that work? I can try compiling them in a virtual environment as a temporary workaround
The last working commit on Debian is fdb3b609e9e669d1577b07f4f5e53b9b11f5b4ed
You can try that until we figured out what's the main problem.
alright I'll try that thanks
considering selection
is a raw pointer in ActionModeLink
I think it might be a dangling pointer at that point? Just looking at the diff in the PR I don't see any initialization at least. Throwing a {}
after the declaration of selection should make it okay, though, since there seems to be appropriate nullchecks in place.
check if this fixes it:
diff --git libopenage/gui/game_control_link.h libopenage/gui/game_control_link.h
index 0aa1baab..c2963948 100644
--- libopenage/gui/game_control_link.h
+++ libopenage/gui/game_control_link.h
@@ -158,7 +158,7 @@ private slots:
QString ability;
QString population;
bool population_warn;
- const UnitSelection *selection;
+ const UnitSelection *selection = nullptr;
QString selection_name;
QString selection_icon;
@@ -307,13 +307,13 @@ private slots:
virtual void on_core_adopted() override;
virtual void componentComplete() override;
- OutputModeLink *mode;
+ OutputModeLink *mode = nullptr;
int effective_mode_index;
int mode_index;
QVariantList modes;
// TODO: remove engine because it's already accessible through the game
- EngineLink *engine;
- GameMainLink *game;
+ EngineLink *engine = nullptr;
+ GameMainLink *game = nullptr;
QString current_player_name;
int current_civ_index;
};
@sandsmark That works!
Do you want to create a PR? :D
I managed to install all dependencies and build everything without any problems.
Then when I try
make run
, a black window opens, then immediately closes and I get this output:stack dump
``` INFO [py] launching openage v0.4.0-83-g6a5df2ad INFO [py] compiled by GNU 8.3.0 INFO launching engine with Path(Union(My machine:
CPU: i7 2640M RAM: 16Gb OS: Debian buster kernel: 4.19.0-1-amd64