View Issue Details

IDProjectCategoryView StatusLast Update
0004452Spring engineGeneralpublic2014-06-24 00:42
Reporterabma Assigned ToKloot  
PrioritynormalSeveritycrashReproducibilityhave not tried
Status closedResolutionfixed 
Target Version98.0 
Summary0004452: SIGFPE in rts/Sim/MoveTypes/GroundMoveType.cpp:1317
DescriptionProgram received signal SIGFPE, Arithmetic exception.
0x0000000000a91196 in CGroundMoveType::CanGetNextWayPoint (this=0x57a0960)
    at rts/Sim/MoveTypes/GroundMoveType.cpp:1317
1317 const float turnFrames = SPRING_CIRCLE_DIVS / turnRate;
(gdb) bt
#0 0x0000000000a91196 in CGroundMoveType::CanGetNextWayPoint (this=0x57a0960)
    at rts/Sim/MoveTypes/GroundMoveType.cpp:1317
#1 0x0000000000a91885 in CGroundMoveType::GetNextWayPoint (this=0x57a0960)
    at rts/Sim/MoveTypes/GroundMoveType.cpp:1388
#2 0x0000000000a8b72a in CGroundMoveType::FollowPath (this=0x57a0960)
    at rts/Sim/MoveTypes/GroundMoveType.cpp:505
0000003 0x0000000000a8ad28 in CGroundMoveType::UpdateOwnerSpeedAndHeading (
    this=0x57a0960) at rts/Sim/MoveTypes/GroundMoveType.cpp:323
0000004 0x0000000000a8ab57 in CGroundMoveType::Update (this=0x57a0960)
    at rts/Sim/MoveTypes/GroundMoveType.cpp:298
0000005 0x0000000000bdad30 in CUnitHandler::Update (this=0x60451a0)
    at rts/Sim/Units/UnitHandler.cpp:226
#6 0x00000000005b7f10 in CGame::SimFrame (this=0x36d6a20)
    at rts/Game/Game.cpp:1552
#7 0x00000000007273b2 in CGame::ClientReadNet (this=0x36d6a20)
    at rts/Net/NetCommands.cpp:507
#8 0x00000000005b5218 in CGame::Update (this=0x36d6a20)
    at rts/Game/Game.cpp:973
#9 0x0000000000c96ae3 in SpringApp::Update (this=0x7fffde606c50)
    at rts/System/SpringApp.cpp:858
0000010 0x0000000000c96c2d in SpringApp::Run (this=0x7fffde606c50)
    at rts/System/SpringApp.cpp:889
#11 0x0000000000c6405e in Run (argc=2, argv=0x7fffde606da8)
---Type <return> to continue, or q <return> to quit---
    at rts/System/Main.cpp:48
0000012 0x0000000000c64677 in main (argc=2, argv=0x7fffde606da8)
    at rts/System/Main.cpp:107
TagsNo tags attached.
Attached Files
20140623_213835_DeltaSiegeDry_97.0.1-87-gee54c27 develop.sdf (Attachment missing)
20140623_224241_DeltaSiegeDry_97.0.1-91-g0444de0 develop.sdf (Attachment missing)
Checked infolog.txt for Errors

Activities

abma

2014-06-23 21:43

administrator   ~0013327

const float turnFrames = SPRING_CIRCLE_DIVS / turnRate;
(gdb) print turnRate
$1 = 0

abma

2014-06-23 21:46

administrator   ~0013328

i guess we need to print a warning/error when turnRate is 0 ?!

abma

2014-06-23 22:05

administrator   ~0013329

print owner->unitDef->name
$4 = {static npos = <optimized out>,
  _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x6094308 "amphbomb"}}

Kloot

2014-06-23 22:07

developer   ~0013330

a consequence of the fact that turnRate is "allowed" to be 0 for gunships...

abma

2014-06-23 22:07

administrator   ~0013331

to reproduce:

/cheat
/give amphbomb

move unit -> SIGFPE

abma

2014-06-23 22:43

administrator   ~0013333

still crashes:
(SIGFPE) in spring 97.0.1-91-g0444de0 develop (Debug):

0000005 <signal handler called>
#6 0x0000000000acb302 in CGroundMoveType::CanGetNextWayPoint (this=0x290aaa90) at rts/Sim/MoveTypes/GroundMoveType.cpp:1317
#7 0x0000000000acb9f1 in CGroundMoveType::GetNextWayPoint (this=0x290aaa90) at rts/Sim/MoveTypes/GroundMoveType.cpp:1388
#8 0x0000000000ac5896 in CGroundMoveType::FollowPath (this=0x290aaa90) at rts/Sim/MoveTypes/GroundMoveType.cpp:505
#9 0x0000000000ac4e94 in CGroundMoveType::UpdateOwnerSpeedAndHeading (this=0x290aaa90) at rts/Sim/MoveTypes/GroundMoveType.cpp:323
0000010 0x0000000000ac4cc3 in CGroundMoveType::Update (this=0x290aaa90) at rts/Sim/MoveTypes/GroundMoveType.cpp:298
#11 0x0000000000c14b08 in CUnitHandler::Update (this=0x8029950) at rts/Sim/Units/UnitHandler.cpp:226
0000012 0x00000000005ced40 in CGame::SimFrame (this=0x29289b0) at rts/Game/Game.cpp:1552
0000013 0x0000000000741110 in CGame::ClientReadNet (this=0x29289b0) at rts/Net/NetCommands.cpp:507
0000014 0x00000000005cc048 in CGame::Update (this=0x29289b0) at rts/Game/Game.cpp:973
#15 0x0000000000cd139f in SpringApp::Update (this=0x7fff44958db0) at rts/System/SpringApp.cpp:858
#16 0x0000000000cd14e9 in SpringApp::Run (this=0x7fff44958db0) at rts/System/SpringApp.cpp:889
#17 0x0000000000c9de20 in Run (argc=1, argv=0x7fff44958f98) at rts/System/Main.cpp:48
#18 0x0000000000c9e64e in main (argc=1, argv=0x7fff44958f98) at rts/System/Main.cpp:107

(gdb) print owner->unitDef->name
$3 = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
    _M_p = 0x59ba0f8 "amphbomb0"}}

abma

2014-06-23 22:49

administrator   ~0013334

note:

/cheat
/give amphbomb

+ some move command

still causes this SIGFPE, too

Kloot

2014-06-23 22:57

developer   ~0013335

Impossible unless Lua sets turnRate to 0 (put a breakpoint at CGroundMoveType::SetMemberValue, check if the hash matches floatMemberPtrs[0]).

I am not really inclined to add clamps around all possible bad values that might be injected by gadgets.

abma

2014-06-23 23:13

administrator   ~0013337

CGroundMoveType::SetMemberValue is called often, but didn't find a match (yet), investigating zk's lua code currently...

example bt:

(gdb) bt
#0 CGroundMoveType::SetMemberValue (this=0xf0bea70, memberHash=1001501915, memberValue=0x7fffffffc4bc) at rts/Sim/MoveTypes/GroundMoveType.cpp:2392
#1 0x00000000007d1b7c in SetMoveTypeValue<float> (mt=0xf0bea70, key=..., value=0) at rts/Lua/LuaSyncedMoveCtrl.cpp:528
#2 0x00000000007d1468 in SetMoveTypeValue (L=0xbf2d460, moveType=0xf0bea70, keyIdx=-2, valIdx=-1) at rts/Lua/LuaSyncedMoveCtrl.cpp:534
0000003 0x00000000007d1674 in SetMoveTypeData (L=0xbf2d460, moveType=0xf0bea70,
    caller=0x1243150 <LuaSyncedMoveCtrl::SetGroundMoveTypeData(lua_State*)::__FUNCTION__> "SetGroundMoveTypeData") at rts/Lua/LuaSyncedMoveCtrl.cpp:559
0000004 0x00000000007d181d in LuaSyncedMoveCtrl::SetGroundMoveTypeData (L=0xbf2d460) at rts/Lua/LuaSyncedMoveCtrl.cpp:595
0000005 0x0000000000e160aa in luaD_precall (L=0xbf2d460, func=0xc4e8c50, nresults=0) at rts/lib/lua/src/ldo.cpp:320
#6 0x0000000000e2b46f in luaV_execute (L=0xbf2d460, nexeccalls=3) at rts/lib/lua/src/lvm.cpp:613
#7 0x0000000000e164b2 in resume (L=0xbf2d460, ud=0xb845c10) at rts/lib/lua/src/ldo.cpp:405
#8 0x0000000000e15430 in luaD_rawrunprotected (L=0xbf2d460, f=0xe163ba <resume(lua_State*, void*)>, ud=0xb845c10) at rts/lib/lua/src/ldo.cpp:116
#9 0x0000000000e16645 in lua_resume (L=0xbf2d460, nargs=0) at rts/lib/lua/src/ldo.cpp:428
0000010 0x0000000000e11983 in auxresume (L=0xb048310, co=0xbf2d460, narg=0) at rts/lib/lua/src/lbaselib.cpp:540
#11 0x0000000000e11a77 in luaB_coresume (L=0xb048310) at rts/lib/lua/src/lbaselib.cpp:559
0000012 0x0000000000e160aa in luaD_precall (L=0xb048310, func=0xb128720, nresults=2) at rts/lib/lua/src/ldo.cpp:320
0000013 0x0000000000e2b46f in luaV_execute (L=0xb048310, nexeccalls=2) at rts/lib/lua/src/lvm.cpp:613
0000014 0x0000000000e164b2 in resume (L=0xb048310, ud=0xb1286e0) at rts/lib/lua/src/ldo.cpp:405
#15 0x0000000000e15430 in luaD_rawrunprotected (L=0xb048310, f=0xe163ba <resume(lua_State*, void*)>, ud=0xb1286e0) at rts/lib/lua/src/ldo.cpp:116
#16 0x0000000000e16645 in lua_resume (L=0xb048310, nargs=0) at rts/lib/lua/src/ldo.cpp:428
#17 0x0000000000e11983 in auxresume (L=0xab5f3e0, co=0xb048310, narg=0) at rts/lib/lua/src/lbaselib.cpp:540
#18 0x0000000000e11a77 in luaB_coresume (L=0xab5f3e0) at rts/lib/lua/src/lbaselib.cpp:559
#19 0x0000000000e160aa in luaD_precall (L=0xab5f3e0, func=0xc9c8910, nresults=2) at rts/lib/lua/src/ldo.cpp:320
0000020 0x0000000000e2b46f in luaV_execute (L=0xab5f3e0, nexeccalls=3) at rts/lib/lua/src/lvm.cpp:613
#21 0x0000000000e1637c in luaD_call (L=0xab5f3e0, func=0xc9c88a0, nResults=0) at rts/lib/lua/src/ldo.cpp:378
---Type <return> to continue, or q <return> to quit---
#22 0x0000000000e0db2c in f_call (L=0xab5f3e0, ud=0x7fffffffd4b0) at rts/lib/lua/src/lapi.cpp:812
#23 0x0000000000e15430 in luaD_rawrunprotected (L=0xab5f3e0, f=0xe0daf7 <f_call(lua_State*, void*)>, ud=0x7fffffffd4b0) at rts/lib/lua/src/ldo.cpp:116
0000024 0x0000000000e167c3 in luaD_pcall (L=0xab5f3e0, func=0xe0daf7 <f_call(lua_State*, void*)>, u=0x7fffffffd4b0, old_top=16, ef=0)
    at rts/lib/lua/src/ldo.cpp:464
#25 0x0000000000e0dbe9 in lua_pcall (L=0xab5f3e0, nargs=1, nresults=0, errfunc=0) at rts/lib/lua/src/lapi.cpp:833
0000026 0x00000000007662a2 in CLuaHandle::ScopedLuaCall::ScopedLuaCall (this=0x7fffffffd5b0, handle=0xab5eed8, state=0xab5f3e0, func=0x0, _nInArgs=1,
    _nOutArgs=0, _errFuncIdx=0, _popErrFunc=false) at rts/Lua/LuaHandle.cpp:276
0000027 0x000000000076662b in CLuaHandle::RunCallInTraceback (this=0xab5eed8, L=0xab5f3e0, hs=0x0, inArgs=1, outArgs=0, errFuncIndex=0, tracebackMsg=...,
    popErrorFunc=false) at rts/Lua/LuaHandle.cpp:346
#28 0x0000000000be4406 in CLuaHandle::RunCallIn (this=0xab5eed8, L=0xab5f3e0, inArgs=1, outArgs=0, errorMsg=...) at rts/Lua/LuaHandle.h:339
0000029 0x0000000000be1fa6 in CLuaUnitScript::RawRunCallIn (this=0x124d98e0, functionId=31, inArgs=1, outArgs=0) at rts/Sim/Units/Scripts/LuaUnitScript.cpp:864
#30 0x0000000000be4732 in CLuaUnitScript::RunCallIn (this=0x124d98e0, id=1, inArgs=1, outArgs=0) at rts/Sim/Units/Scripts/LuaUnitScript.cpp:405
#31 0x0000000000be0b00 in CLuaUnitScript::Call (this=0x124d98e0, fn=1, arg1=0) at rts/Sim/Units/Scripts/LuaUnitScript.cpp:479
#32 0x0000000000be211a in CLuaUnitScript::StartMoving (this=0x124d98e0, reversing=false) at rts/Sim/Units/Scripts/LuaUnitScript.cpp:884
#33 0x0000000000ad18bc in CGroundMoveType::UpdateOwnerPos (this=0xf0bea70, oldSpeedVector=..., newSpeedVector=...)
    at rts/Sim/MoveTypes/GroundMoveType.cpp:2342
0000034 0x0000000000ac4d2d in CGroundMoveType::Update (this=0xf0bea70) at rts/Sim/MoveTypes/GroundMoveType.cpp:299
0000035 0x0000000000c14b08 in CUnitHandler::Update (this=0x7864400) at rts/Sim/Units/UnitHandler.cpp:226
#36 0x00000000005ced40 in CGame::SimFrame (this=0x2296580) at rts/Game/Game.cpp:1552
#37 0x0000000000741110 in CGame::ClientReadNet (this=0x2296580) at rts/Net/NetCommands.cpp:507
#38 0x00000000005cc048 in CGame::Update (this=0x2296580) at rts/Game/Game.cpp:973
0000039 0x0000000000cd139f in SpringApp::Update (this=0x7fffffffe1f0) at rts/System/SpringApp.cpp:858
#40 0x0000000000cd14e9 in SpringApp::Run (this=0x7fffffffe1f0) at rts/System/SpringApp.cpp:889
---Type <return> to continue, or q <return> to quit---
#41 0x0000000000c9de20 in Run (argc=1, argv=0x7fffffffe3d8) at rts/System/Main.cpp:48
0000042 0x0000000000c9e64e in main (argc=1, argv=0x7fffffffe3d8) at rts/System/Main.cpp:107

abma

2014-06-23 23:20

administrator   ~0013338

yep, it is set:

https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaRules/Gadgets/unit_attributes.lua#L252

abma

2014-06-23 23:25

administrator   ~0013339

upstream report:
https://github.com/ZeroK-RTS/Zero-K/issues/25

Kloot

2014-06-24 00:42

developer   ~0013341

ZK bug then.

If the intent is to fully immobilize a unit the correct way would be setting turnAccel to 0, not turnRate.

Issue History

Date Modified Username Field Change
2014-06-23 21:43 abma New Issue
2014-06-23 21:43 abma Note Added: 0013327
2014-06-23 21:44 abma File Added: 20140623_213835_DeltaSiegeDry_97.0.1-87-gee54c27 develop.sdf
2014-06-23 21:45 abma Target Version => 98.0
2014-06-23 21:46 abma Note Added: 0013328
2014-06-23 22:01 abma Description Updated
2014-06-23 22:01 abma Summary SIGFPE in rts/Game/UI/StartPosSelecter.cpp:123 => SIGFPE in rts/Sim/MoveTypes/GroundMoveType.cpp:1317
2014-06-23 22:05 abma Note Added: 0013329
2014-06-23 22:07 Kloot Note Added: 0013330
2014-06-23 22:07 abma Note Added: 0013331
2014-06-23 22:14 Kloot Changeset attached => spring develop 35627dda
2014-06-23 22:14 Kloot Assigned To => Kloot
2014-06-23 22:14 Kloot Status new => resolved
2014-06-23 22:14 Kloot Resolution open => fixed
2014-06-23 22:43 abma Note Added: 0013333
2014-06-23 22:43 abma Status resolved => new
2014-06-23 22:44 abma File Added: 20140623_224241_DeltaSiegeDry_97.0.1-91-g0444de0 develop.sdf
2014-06-23 22:49 abma Note Added: 0013334
2014-06-23 22:57 Kloot Note Added: 0013335
2014-06-23 23:13 abma Note Added: 0013337
2014-06-23 23:20 abma Note Added: 0013338
2014-06-23 23:25 abma Note Added: 0013339
2014-06-24 00:42 Kloot Note Added: 0013341
2014-06-24 00:42 Kloot Status new => closed