SpringCabal / Area-17

Ludum Dare 33 game
0 stars 3 forks source link

failed assert when starting from spring menu #40

Closed abma closed 9 years ago

abma commented 9 years ago

when downloading pr-downloader area17:test "Area 17 - v01"

and starting via menu then i get this failed assert in a debug build in the engine:

http://paste.springfiles.com/view/ff99815c

relevant lines:

[f=0000000] Loaded SYNCED gadget: Unit Spawner Aborted (SIGABRT) in spring 100.0.1-123-g911c81b develop (Debug) Halted Stacktrace for Spring 100.0.1-123-g911c81b develop (Debug) using libunwind: /home/abma/dev/spring/develop/rts/System/Platform/Linux/CrashHandler.cpp:815 CrashHandler::HaltedStacktrace(std::string const&, siginfot, ucontext_) /home/abma/dev/spring/develop/rts/System/Platform/Linux/CrashHandler.cpp:921 CrashHandler::HandleSignal(int, siginfot, void_) /lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10) [0x7fe66b858d10] restore_rt /build/buildd/glibc-2.21/signal/../sysdeps/unix/sysv/linux/raise.c:55 __GI_raise /build/buildd/glibc-2.21/stdlib/abort.c:91 GI_abort /build/buildd/glibc-2.21/assert/assert.c:92 __assert_fail_base /lib/x86_64-linux-gnu/libc.so.6(+0x2e0f2) [0x7fe667c7e0f2] __assert_fail /home/abma/dev/spring/develop/rts/Sim/Objects/SolidObject.cpp:418 CSolidObject::ForcedSpin(float3 const&) /home/abma/dev/spring/develop/rts/Lua/LuaSyncedCtrl.cpp:522 SetSolidObjectDirection(luaState, CSolidObject_) /home/abma/dev/spring/develop/rts/Lua/LuaSyncedCtrl.cpp:2305 LuaSyncedCtrl::SetUnitDirection(luaState) /home/abma/dev/spring/develop/rts/lib/lua/src/ldo.cpp:320 luaD_precall(luaState, luaTValue, int) /home/abma/dev/spring/develop/rts/lib/lua/src/lvm.cpp:613 luaV_execute(luaState, int) ...

abma commented 9 years ago

very likely a call of SetUnitDirection() with some out of bounds flag

abma commented 9 years ago

https://github.com/SpringCabal/Area-17/blob/d468afdfbb9589b7f0635711108033a0e3c259cb/LuaRules/Gadgets/game_load.lua#L35

gajop commented 9 years ago

I'm pretty sure engine is just broken

abma commented 9 years ago

hmm, for some reason this line is missing in infolog.txt:

virtual void CSolidObject::ForcedSpin(const float3&): Assertion `math::fabsf(newDir.SqLength() - 1.0f) <= float3::NORMALIZE_EPS' failed.

NORMALIZE_EPS is this. const float float3::NORMALIZE_EPS = 1e-12f;

so, this failed assert means, that some value got insane -> bad as it could crash / lead to a desync.

gajop commented 9 years ago

To give some additional detail:

abma commented 9 years ago

FYI: thats no crash...

abma commented 9 years ago

http://www.cplusplus.com/reference/cassert/assert/

abma commented 9 years ago

I think it's fairly easy to reproduce it, just write a gadget that rotates a unit using SetUnitDirection in any way - e.g. SetUnitDirection(unitID, 0, 0, 0) - it used to crash debug builds in 100% cases when I tried it.

then why is there no mantis report about this? :-|

gajop commented 9 years ago

Check note 2. I was also told not to report it by jk. You're the first person besides me that had it happen for them, and I just gave up on debug builds a while ago.

abma commented 9 years ago

https://springrts.com/mantis/view.php?id=4942

abma commented 9 years ago

not sure who to blame, but Spring.SetUnitDirection(0,0,0) seems an invalid call.

gajop commented 9 years ago

Maybe, but I think i had it if i were to put some params to 1 or something. Just to be pedantic, it's SetUnitDirection(unitID, 0, 0, 0)

The correct parameters would be something like: SetUnitDirection(unitID, 1, 0, 0)

gajop commented 9 years ago

Does https://github.com/spring/spring/commit/d6f6cd4b750f895a7c1ff5d92644a3d3433d2fb2 mean it's fixed now?

gajop commented 9 years ago

I'm going to guess it is. Reopen if the issue persists.