MegaGlest / megaglest-source

MegaGlest real-time strategy game engine (cross-platform, 3-d)
http://megaglest.org/
348 stars 89 forks source link

unit_updater.cpp::updateUnitCommand Line: 439] Error [ut == NULL Stack Trace #150

Closed andy5995 closed 6 years ago

andy5995 commented 7 years ago

There are 2 forum posts related to this:

  1. 3.9.1: unit_updater.cpp::updateRepair Line: 2170] Error [ut == NULL https://forum.megaglest.org/index.php?topic=9490.0

  2. error NULL crash

Today it happened while playing with shared units. So far that may be the only clue as to reproducing it.

Also, it happened immediately after I selected to build a library, (but I hadn't placed it yet). And looking at the screenshot, I see there wasn't enough wood.

See this forum post for more details about today's game.

The game crashes for all players at the same time.

Run from the headless dev server.

screen15.jpg

*ERROR* [2017-02-12 15:49:41] In [/home/andy/src/megaglest-source/source/glest_game/world/unit_updater.cpp::updateRepair Line: 2307] Error [ut == NULL
Stack Trace:
./megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)address [0x563ef3bd6c4c] line: 0
./megaglest:Glest::Game::Map::findBestBuildApproach(Glest::Game::Unit const*, Shared::Graphics::Vec2<int>, Glest::Game::UnitType const*) constaddress [0x563ef3aa00f4] line: 0
./megaglest:Glest::Game::UnitUpdater::updateRepair(Glest::Game::Unit*, int)address [0x563ef3ad4558] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnitCommand(Glest::Game::Unit*, int)address [0x563ef3ac670e] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnit(Glest::Game::Unit*)address [0x563ef3acc81d] line: 0
./megaglest:Glest::Game::World::updateAllFactionUnits()address [0x563ef3aed0e9] line: 0
./megaglest:Glest::Game::World::update()address [0x563ef3af8a47] line: 0
./megaglest:Glest::Game::Game::update()address [0x563ef3685212] line: 0
./megaglest:Glest::Game::Program::loopWorker()address [0x563ef37d8492] line: 0
./megaglest:Glest::Game::glestMain(int, char**)address [0x563ef37c2565] line: 0
./megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x563ef37c9b34] line: 0
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f91b20402b1] line: 0
./megaglest:_start()address [0x563ef35edb0a] line: 0
]
*ERROR* [2017-02-12 15:49:41] In [/home/andy/src/megaglest-source/source/glest_game/world/unit_updater.cpp::updateUnitCommand Line: 503] Error [ut == NULL
Stack Trace:
./megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)address [0x563ef3bd6c4c] line: 0
./megaglest:Glest::Game::Map::findBestBuildApproach(Glest::Game::Unit const*, Shared::Graphics::Vec2<int>, Glest::Game::UnitType const*) constaddress [0x563ef3aa00f4] line: 0
./megaglest:Glest::Game::UnitUpdater::updateRepair(Glest::Game::Unit*, int)address [0x563ef3ad4558] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnitCommand(Glest::Game::Unit*, int)address [0x563ef3ac670e] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnit(Glest::Game::Unit*)address [0x563ef3acc81d] line: 0
./megaglest:Glest::Game::World::updateAllFactionUnits()address [0x563ef3aed0e9] line: 0
./megaglest:Glest::Game::World::update()address [0x563ef3af8a47] line: 0
./megaglest:Glest::Game::Game::update()address [0x563ef3685212] line: 0
./megaglest:Glest::Game::Program::loopWorker()address [0x563ef37d8492] line: 0
./megaglest:Glest::Game::glestMain(int, char**)address [0x563ef37c2565] line: 0
./megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x563ef37c9b34] line: 0
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f91b20402b1] line: 0
./megaglest:_start()address [0x563ef35edb0a] line: 0

Stack Trace:
./megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)address [0x563ef3bd6c4c] line: 0
./megaglest:Glest::Game::UnitUpdater::updateRepair(Glest::Game::Unit*, int)address [0x563ef3ad4a32] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnitCommand(Glest::Game::Unit*, int)address [0x563ef3ac670e] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnit(Glest::Game::Unit*)address [0x563ef3acc81d] line: 0
./megaglest:Glest::Game::World::updateAllFactionUnits()address [0x563ef3aed0e9] line: 0
./megaglest:Glest::Game::World::update()address [0x563ef3af8a47] line: 0
./megaglest:Glest::Game::Game::update()address [0x563ef3685212] line: 0
./megaglest:Glest::Game::Program::loopWorker()address [0x563ef37d8492] line: 0
./megaglest:Glest::Game::glestMain(int, char**)address [0x563ef37c2565] line: 0
./megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x563ef37c9b34] line: 0
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f91b20402b1] line: 0
./megaglest:_start()address [0x563ef35edb0a] line: 0
]
*ERROR* [2017-02-12 15:49:41] In [game.cpp::update Line: 2779] Error [ut == NULL
Stack Trace:
./megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)address [0x563ef3bd6c4c] line: 0
./megaglest:Glest::Game::Map::findBestBuildApproach(Glest::Game::Unit const*, Shared::Graphics::Vec2<int>, Glest::Game::UnitType const*) constaddress [0x563ef3aa00f4] line: 0
./megaglest:Glest::Game::UnitUpdater::updateRepair(Glest::Game::Unit*, int)address [0x563ef3ad4558] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnitCommand(Glest::Game::Unit*, int)address [0x563ef3ac670e] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnit(Glest::Game::Unit*)address [0x563ef3acc81d] line: 0
./megaglest:Glest::Game::World::updateAllFactionUnits()address [0x563ef3aed0e9] line: 0
./megaglest:Glest::Game::World::update()address [0x563ef3af8a47] line: 0
./megaglest:Glest::Game::Game::update()address [0x563ef3685212] line: 0
./megaglest:Glest::Game::Program::loopWorker()address [0x563ef37d8492] line: 0
./megaglest:Glest::Game::glestMain(int, char**)address [0x563ef37c2565] line: 0
./megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x563ef37c9b34] line: 0
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f91b20402b1] line: 0
./megaglest:_start()address [0x563ef35edb0a] line: 0

Stack Trace:
./megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)address [0x563ef3bd6c4c] line: 0
./megaglest:Glest::Game::UnitUpdater::updateRepair(Glest::Game::Unit*, int)address [0x563ef3ad4a32] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnitCommand(Glest::Game::Unit*, int)address [0x563ef3ac670e] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnit(Glest::Game::Unit*)address [0x563ef3acc81d] line: 0
./megaglest:Glest::Game::World::updateAllFactionUnits()address [0x563ef3aed0e9] line: 0
./megaglest:Glest::Game::World::update()address [0x563ef3af8a47] line: 0
./megaglest:Glest::Game::Game::update()address [0x563ef3685212] line: 0
./megaglest:Glest::Game::Program::loopWorker()address [0x563ef37d8492] line: 0
./megaglest:Glest::Game::glestMain(int, char**)address [0x563ef37c2565] line: 0
./megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x563ef37c9b34] line: 0
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f91b20402b1] line: 0
./megaglest:_start()address [0x563ef35edb0a] line: 0

Stack Trace:
./megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)address [0x563ef3bd6c4c] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnitCommand(Glest::Game::Unit*, int)address [0x563ef3ac699c] line: 0
./megaglest:Glest::Game::UnitUpdater::updateUnit(Glest::Game::Unit*)address [0x563ef3acc81d] line: 0
./megaglest:Glest::Game::World::updateAllFactionUnits()address [0x563ef3aed0e9] line: 0
./megaglest:Glest::Game::World::update()address [0x563ef3af8a47] line: 0
./megaglest:Glest::Game::Game::update()address [0x563ef3685212] line: 0
./megaglest:Glest::Game::Program::loopWorker()address [0x563ef37d8492] line: 0
./megaglest:Glest::Game::glestMain(int, char**)address [0x563ef37c2565] line: 0
./megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x563ef37c9b34] line: 0
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f91b20402b1] line: 0
./megaglest:_start()address [0x563ef35edb0a] line: 0
]
softcoder commented 7 years ago

Please try the latest git and see if this can be reproduced. I tried a fix for this use case.

andy5995 commented 7 years ago

This has only happened 2x in the last six months, but I'll definitely report if it happens again.

Can you say if it's possible that having "shared resources" on may have something to do with it? If so, we can play more games with shared resources on to test for it.

softcoder commented 7 years ago

Its hard to say exactly what triggers this, but it does 'look' like it may be related to shared teams. Essentially a peer units command has no unit type when we expect it to have one (during a repair). Now in such a case I wont try to continue in this case so the null error should no longer be triggered.

andy5995 commented 7 years ago

ok. And to be clear, during today's game, "shared teams" was off, "shared resources" was on.

softcoder commented 7 years ago

Can we close this?

andy5995 commented 7 years ago

I'd say more testing is needed because of how rarely it happened; or close for now and reopen if it's reported again.

titiger commented 7 years ago

I say we keep it open to track it if it happens again.