Andrettin / Wyrmsun

Strategy game based on history, mythology and fiction
http://andrettin.github.io/
GNU General Public License v2.0
307 stars 48 forks source link

crash Artix latest #212

Open oEjk opened 2 years ago

oEjk commented 2 years ago

where can I find crash info? crashes a few min into first dwarf scenario

built on artix today

warnings

[ 16%] Building CXX object CMakeFiles/wyrmgus.dir/Unity/unity_player_cxx.cxx.o In file included from /run/media/a/Greg/Projects/wyrmsun/src/Wyrmgus-5.3.5/CMakeFiles/wyrmgus.dir/Unity/unity_player_cxx.cxx:17: /run/media/a/Greg/Projects/wyrmsun/src/Wyrmgus-5.3.5/src/player/player.cpp: In member function ‘void CPlayer::set_enemy_diplomatic_stance_with(CPlayer*)’: /run/media/a/Greg/Projects/wyrmsun/src/Wyrmgus-5.3.5/src/player/player.cpp:5176:57: warning: format not a string literal and no format arguments [-Wformat-security] 5176 | CPlayer::GetThisPlayer()->Notify(message.c_str()); | ~~~~~~^~~~~~~

==> Checking for packaging issues... ==> WARNING: Package contains reference to $srcdir usr/bin/wyrmgus ==> Creating package "wyrmsun"...

only 2

Andrettin commented 2 years ago

Thanks for the info! I can't reproduce the crash, unfortunately, but I've fixed the warning you mentioned: https://github.com/Andrettin/Wyrmgus/commit/0e1f7b365aac401434a94198d6339fcc1f2c815b

oEjk commented 2 years ago

anyway I can debug this?

oEjk commented 2 years ago

I was building using arch aur https://aur.archlinux.org/packages/wyrmsun

tried to directly clone and build

cmake

CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:315 (message): Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

FindOpenGL found both a legacy GL library:

OPENGL_gl_LIBRARY: /usr/lib/libGL.so                                                                                                                                                                           

and GLVND libraries for OpenGL and GLX:

OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so                                                                                                                                                                   
OPENGL_glx_LIBRARY: /usr/lib/libGLX.so                                                                                                                                                                         

OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
CMakeLists.txt:1414 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

make [ 2%] Automatic MOC for target wyrmgus [ 2%] Built target wyrmgus_autogen [ 4%] Generating tolua.cpp

** tolua warning: Mapping variable to global may degrade performance.

[ 6%] Building CXX object CMakeFiles/wyrmgus.dir/cmake_pch.hxx.gch [ 8%] Building CXX object CMakeFiles/wyrmgus.dir/wyrmgus_autogen/mocs_compilation.cpp.o [ 10%] Building CXX object CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx.o In file included from /Projects/Wyrmgus/src/unit/script_unit.cpp:41, from /Projects/Wyrmgus/CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx:13: /Projects/Wyrmgus/src/include/grand_strategy.h: In constructor ‘CGrandStrategyFaction::CGrandStrategyFaction()’: /Projects/Wyrmgus/src/include/grand_strategy.h:140:31: error: ‘CGrandStrategyFaction::FactionTier’ will be initialized after [-Werror=reorder] 140 | wyrmgus::faction_tier FactionTier; /// What is the tier of this faction (barony, etc.). | ^~~ /Projects/Wyrmgus/src/include/grand_strategy.h:139:34: error: ‘wyrmgus::government_type CGrandStrategyFaction::government_type’ [-Werror=reorder] 139 | wyrmgus::government_type government_type; /// Government type of the faction (-1 = none). | ^~~~~~~ /Projects/Wyrmgus/src/include/grand_strategy.h:114:9: error: when initialized here [-Werror=reorder] 114 | CGrandStrategyFaction() : | ^~~~~ In file included from /Projects/Wyrmgus/CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx:15: /Projects/Wyrmgus/src/unit/script_unit_type.cpp: In function ‘int CclDefineUnitType(lua_State)’: /Projects/Wyrmgus/src/unit/script_unit_type.cpp:1292:35: error: unused variable ‘subargs’ [-Werror=unused-variable] 1292 | const int subargs = lua_rawlen(l, -1); | ^~~ /Projects/Wyrmgus/src/unit/script_unit_type.cpp:1300:35: error: unused variable ‘subargs’ [-Werror=unused-variable] 1300 | const int subargs = lua_rawlen(l, -1); | ^~~ /Projects/Wyrmgus/src/unit/script_unit_type.cpp: In function ‘int CclDefineDecorations(lua_State)’: /Projects/Wyrmgus/src/unit/script_unit_type.cpp:2596:23: error: ‘void memset(void, int, size_t)’ clearing an object of non-trivial type ‘struct CclDefineDecorations(lua_State)::’; use assignment or value-initialization instead [-Werror=class-memaccess] 2596 | memset(&tmp, 0, sizeof(tmp)); | ~~^~~~~~ /Projects/Wyrmgus/src/unit/script_unit_type.cpp:2562:16: note: ‘struct CclDefineDecorations(lua_State)::’ declared here 2562 | struct { | ^ In file included from /Projects/Wyrmgus/CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx:19: /Projects/Wyrmgus/src/unit/unit.cpp: In member function ‘void CUnit::Init()’: /Projects/Wyrmgus/src/unit/unit.cpp:484:15: error: ‘void memset(void, int, size_t)’ clearing an object of non-trivial type ‘struct CUnit::_unitanim’; use assignment or value-initialization instead [-Werror=class-memaccess] 484 | memset(&Anim, 0, sizeof(Anim)); | ~~^~~~~~~~ In file included from /Projects/Wyrmgus/src/unit/build.cpp:46, from /Projects/Wyrmgus/CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx:3: /Projects/Wyrmgus/src/unit/unit.h:986:16: note: ‘struct CUnit::_unitanim’ declared here 986 | struct _unitanim { | ^~~ /Projects/Wyrmgus/src/unit/unit.cpp:485:15: error: ‘void memset(void, int, size_t)’ clearing an object of non-trivial type ‘struct CUnit::_unitanim’; use assignment or value-initialization instead [-Werror=class-memaccess] 485 | memset(&WaitBackup, 0, sizeof(WaitBackup)); | ~~^~~~~~~~ /Projects/Wyrmgus/src/unit/unit.h:986:16: note: ‘struct CUnit::_unitanim’ declared here 986 | struct _unitanim { | ^~~ /Projects/Wyrmgus/src/unit/unit.cpp: In member function ‘void CUnit::UpdateSoldUnits()’: /Projects/Wyrmgus/src/unit/unit.cpp:2826:85: error: suggest parentheses around ‘&&’ within ‘||’ [-Werror=parentheses] 2826 | (custom_hero->get_civilization() != nullptr && custom_hero->get_civilization() == civilization || custom_hero->get_unit_type() == civilization->get_class_unit_type(custom_hero->get_unit_type()->get_unit_class())) | ~~~~~~~~~^~~~~~~~~~~~ /Projects/Wyrmgus/src/unit/unit.cpp: In function ‘void LetUnitDie(CUnit&, bool)’: /Projects/Wyrmgus/src/unit/unit.cpp:7553:106: error: the address of ‘wyrmgus::animation_set::Death’ will never be NULL [-Werror=address] 7553 | if (type->get_corpse_type() != nullptr || (unit.get_animation_set() && unit.get_animation_set()->Death)) { | ~~~~~~^~~~~ In file included from /Projects/Wyrmgus/src/unit/unit_type.h:29, from /Projects/Wyrmgus/src/unit/build.cpp:32: /Projects/Wyrmgus/src/animation/animation_set.h:97:27: note: ‘wyrmgus::animation_set::Death’ declared here 97 | const CAnimation Death[ANIMATIONS_DEATHTYPES + 1]; | ^~~~~ In file included from /Projects/Wyrmgus/CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx:27: /Projects/Wyrmgus/src/unit/unit_find.cpp: In constructor ‘TerrainFinder::TerrainFinder(const CPlayer&, int, wyrmgus::tile_flag, const wyrmgus::resource, Vec2i, int, const wyrmgus::landmass)’: /Projects/Wyrmgus/src/unit/unit_find.cpp:129:16: error: ‘TerrainFinder::resPos’ will be initialized after [-Werror=reorder] 129 | Vec2i resPos; | ^~ /Projects/Wyrmgus/src/unit/unit_find.cpp:126:13: error: ‘int TerrainFinder::z’ [-Werror=reorder] 126 | int z; | ^ /Projects/Wyrmgus/src/unit/unit_find.cpp:113:18: error: when initialized here [-Werror=reorder] 113 | explicit TerrainFinder(const CPlayer &player, const int maxDist, const tile_flag movemask, const wyrmgus::resource resource, Vec2i resPos, const int z, const landmass landmass) : | ^~~~~ /Projects/Wyrmgus/src/unit/unit_find.cpp: In constructor ‘BestRangeTargetFinder::FillBadGood::FillBadGood(const CUnit&, int, std::vector&, std::vector&, int)’: /Projects/Wyrmgus/src/unit/unit_find.cpp:1360:27: error: ‘BestRangeTargetFinder::FillBadGood::size’ will be initialized after [-Werror=reorder] 1360 | const int size; | ^~~~ /Projects/Wyrmgus/src/unit/unit_find.cpp:1358:35: error: ‘std::vector& BestRangeTargetFinder::FillBadGood::good’ [-Werror=reorder] 1358 | std::vector &good; | ^~~~ /Projects/Wyrmgus/src/unit/unit_find.cpp:1188:26: error: when initialized here [-Werror=reorder] 1188 | explicit FillBadGood(const CUnit &a, const int r, std::vector &g, std::vector &b, const int s) | ^~~ /Projects/Wyrmgus/src/unit/unit_find.cpp: In member function ‘void BestRangeTargetFinder::Compute(CUnit)’: /Projects/Wyrmgus/src/unit/unit_find.cpp:1394:27: error: unused variable ‘missile_range’ [-Werror=unused-variable] 1394 | const int missile_range = attacker->GetMissile().Missile->get_range() + range - 1; | ^~~~~ In file included from /Projects/Wyrmgus/CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx:41: /Projects/Wyrmgus/src/unit/unit_type_variation.cpp: In constructor ‘wyrmgus::unit_type_variation::unit_type_variation(const std::string&, const wyrmgus::unit_type, int)’: /Projects/Wyrmgus/src/unit/unit_type_variation.cpp:55:15: error: ‘void memset(void, int, size_t)’ clearing an object of type ‘class std::shared_ptr’ with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess] 55 | memset(LayerSprites, 0, sizeof(LayerSprites)); | ~~^~~~~~~~~~~ In file included from /usr/include/c++/12.1.0/bits/fs_path.h:46, from /usr/include/c++/12.1.0/filesystem:45, from /Projects/Wyrmgus/src/pch.h:44, from /Projects/Wyrmgus/CMakeFiles/wyrmgus.dir/cmake_pch.hxx:5, from : /usr/include/c++/12.1.0/bits/shared_ptr.h:175:11: note: ‘class std::shared_ptr’ declared here 175 | class shared_ptr : public shared_ptr<_Tp> | ^~~~~~ /Projects/Wyrmgus/src/unit/unit_type_variation.cpp:56:15: error: ‘void memset(void, int, size_t)’ clearing an object of type ‘class std::shared_ptr’ with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess] 56 | memset(SpriteWhenLoaded, 0, sizeof(SpriteWhenLoaded)); | ~~^~~~~~~~~~~ /usr/include/c++/12.1.0/bits/shared_ptr.h:175:11: note: ‘class std::shared_ptr’ declared here 175 | class shared_ptr : public __shared_ptr<_Tp> | ^~~~~~ /Projects/Wyrmgus/src/unit/unit_type_variation.cpp:57:15: error: ‘void memset(void, int, size_t)’ clearing an object of type ‘class std::shared_ptr’ with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess] 57 | memset(SpriteWhenEmpty, 0, sizeof(SpriteWhenEmpty)); | ~~^~~~~~~~~~~~~ /usr/include/c++/12.1.0/bits/shared_ptr.h:175:11: note: ‘class std::shared_ptr’ declared here 175 | class shared_ptr : public shared_ptr<_Tp> | ^~~~~~ /Projects/Wyrmgus/src/unit/unit_type.h: In constructor ‘wyrmgus::unit_type::unit_type(const std::string&)’: /Projects/Wyrmgus/src/unit/unit_type.h:1473:21: error: ‘wyrmgus::unit_type::domain’ will be initialized after [-Werror=reorder] 1473 | unit_domain domain; //whether the unit is a land, water or etc. unit | ^~ /Projects/Wyrmgus/src/unit/unit_type.h:1380:27: error: ‘wyrmgus::colorization_type wyrmgus::unit_type::colorization’ [-Werror=reorder] 1380 | colorization_type colorization; | ^~~~ In file included from /Projects/Wyrmgus/CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx:43: /Projects/Wyrmgus/src/unit/unit_type.cpp:640:1: error: when initialized here [-Werror=reorder] 640 | unit_type::unit_type(const std::string &identifier) : detailed_data_entry(identifier), | ^~~~~ /Projects/Wyrmgus/src/unit/unit_type.h:1543:19: error: ‘wyrmgus::unit_type::MovementMask’ will be initialized after [-Werror=reorder] 1543 | tile_flag MovementMask; /// Unit check this map flags for move | ^~~~ /Projects/Wyrmgus/src/unit/unit_type.h:1493:25: error: ‘wyrmgus::can_target_flag wyrmgus::unit_type::can_target_flags’ [-Werror=reorder] 1493 | can_target_flag can_target_flags; //which units can it attack | ^~~~ /Projects/Wyrmgus/src/unit/unit_type.cpp:640:1: error: when initialized here [-Werror=reorder] 640 | unit_type::unit_type(const std::string &identifier) : detailed_data_entry(identifier), | ^~~~~ /Projects/Wyrmgus/src/unit/unit_type.cpp:654:15: error: ‘void memset(void, int, size_t)’ clearing an object of type ‘class std::shared_ptr’ with no trivial copy-assignment; use assignment or value-initialization instead [-Werror=class-memaccess] 654 | memset(LayerSprites, 0, sizeof(LayerSprites)); | ~~^~~~~~~~~~~ /usr/include/c++/12.1.0/bits/shared_ptr.h:175:11: note: ‘class std::shared_ptr’ declared here 175 | class shared_ptr : public __shared_ptr<_Tp> | ^~~~~~ /Projects/Wyrmgus/src/unit/unit_type.cpp: In function ‘std::string GetUnitTypeStatsString(const std::string&)’: /Projects/Wyrmgus/src/unit/unit_type.cpp:2895:258: error: enum constant in boolean context [-Werror=int-in-bool-context] 2895 | var == SPEEDBONUS_INDEX || var == RAIL_SPEED_BONUS_INDEX || var == SUPPLY_INDEX || var == TIMEEFFICIENCYBONUS_INDEX || var == RESEARCHSPEEDBONUS_INDEX || var == GARRISONEDRANGEBONUS_INDEX || CAPTURE_HP_THRESHOLD_INDEX) | ^~~~~~

/Projects/Wyrmgus/src/unit/unit.cpp: In instantiation of ‘void MapMarkUnitSightRec(const CUnit&, const Vec2i&, int, int) [with void ( sight_marker)(const CPlayer&, unsigned int, int) = MapMarkTileSight; void ( detect_cloak_marker)(const CPlayer&, unsigned int, int) = MapMarkTileDetectCloak; void ( ethereal_vision_marker)(const CPlayer&, unsigned int, int) = MapMarkTileDetectEthereal; Vec2i = Vec2T]’: /Projects/Wyrmgus/src/unit/unit.cpp:3590:90: required from here /Projects/Wyrmgus/src/unit/unit.cpp:3541:71: error: the address of ‘void MapMarkTileDetectCloak(const CPlayer&, unsigned int, int)’ will never be NULL [-Werror=address] 3541 | if (unit.Type && unit.Type->BoolFlag[DETECTCLOAK_INDEX].value && detect_cloak_marker) { | ~~~~~~~~~~~~^~~~~~~~ In file included from /Projects/Wyrmgus/src/unit/build.cpp:37: /Projects/Wyrmgus/src/map/map.h:426:13: note: ‘void MapMarkTileDetectCloak(const CPlayer&, unsigned int, int)’ declared here 426 | extern void MapMarkTileDetectCloak(const CPlayer &player, const unsigned int index, const int z); | ^~~~~~ /Projects/Wyrmgus/src/unit/unit.cpp:3546:55: error: the address of ‘void MapMarkTileDetectEthereal(const CPlayer&, unsigned int, int)’ will never be NULL [-Werror=address] 3546 | if (unit.Variable[ETHEREALVISION_INDEX].Value && ethereal_vision_marker) { /Projects/Wyrmgus/src/map/map.h:431:13: note: ‘void MapMarkTileDetectEthereal(const CPlayer&, unsigned int, int)’ declared here 431 | extern void MapMarkTileDetectEthereal(const CPlayer &player, const unsigned int index, const int z); | ^~~~~~~~~ /Projects/Wyrmgus/src/unit/unit.cpp: In instantiation of ‘void MapMarkUnitSightRec(const CUnit&, const Vec2i&, int, int) [with void ( sight_marker)(const CPlayer&, unsigned int, int) = MapUnmarkTileSight; void ( detect_cloak_marker)(const CPlayer&, unsigned int, int) = MapUnmarkTileDetectCloak; void ( ethereal_vision_marker)(const CPlayer&, unsigned int, int) = MapUnmarkTileDetectEthereal; Vec2i = Vec2T]’: /Projects/Wyrmgus/src/unit/unit.cpp:3618:96: required from here /Projects/Wyrmgus/src/unit/unit.cpp:3541:71: error: the address of ‘void MapUnmarkTileDetectCloak(const CPlayer&, unsigned int, int)’ will never be NULL [-Werror=address] 3541 | if (unit.Type && unit.Type->BoolFlag[DETECTCLOAK_INDEX].value && detect_cloak_marker) { | ~~~~~~~~~~~~^~~~~~~~ /Projects/Wyrmgus/src/map/map.h:428:13: note: ‘void MapUnmarkTileDetectCloak(const CPlayer&, unsigned int, int)’ declared here 428 | extern void MapUnmarkTileDetectCloak(const CPlayer &player, const unsigned int index, const int z); | ^~~~~~~~ /Projects/Wyrmgus/src/unit/unit.cpp:3546:55: error: the address of ‘void MapUnmarkTileDetectEthereal(const CPlayer&, unsigned int, int)’ will never be NULL [-Werror=address] 3546 | if (unit.Variable[ETHEREALVISION_INDEX].Value && ethereal_vision_marker) { /Projects/Wyrmgus/src/map/map.h:433:13: note: ‘void MapUnmarkTileDetectEthereal(const CPlayer&, unsigned int, int)’ declared here 433 | extern void MapUnmarkTileDetectEthereal(const CPlayer &player, const unsigned int index, const int z); | ^~~~~~~ cc1plus: all warnings being treated as errors make[2]: [CMakeFiles/wyrmgus.dir/build.make:131: CMakeFiles/wyrmgus.dir/Unity/unity_unit_cxx.cxx.o] Error 1 make[1]: [CMakeFiles/Makefile2:90: CMakeFiles/wyrmgus.dir/all] Error 2 make: *** [Makefile:166: all] Error 2

Andrettin commented 2 years ago

Sorry, I had just set warnings to be treated as errors (in order to use the GitHub actions reports to get better info on possible bug sources). I made that an option which is set to OFF by default now, so it should compile for you now.

About crash info, there should be an stderr.txt file in your game's folder. Within it there could be more information on the crash.

oEjk commented 2 years ago

not in .local/share/Wyrmsun or the save below it any other thoughts?

edit: file not found in a search of all drives