View Issue Details

IDProjectCategoryView StatusLast Update
0002585Spring engineGeneralpublic2011-08-01 12:20
Reporterabma Assigned ToKloot  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Target Version83.0Fixed in Version0.82.7+git 
Summary0002585: (master) assert in UnitHandler.cpp:273
Descriptionhappened in a KAIKvsKAIK testgame (testmonkey found it! :)

(see attachment for more logs if needed...)
Additional Informationspring: /home/abma/dev/spring/master/rts/Sim/Units/UnitHandler.cpp:273: void CUnitHandler::Update(): Assertion `unit->pos.z >= -(float3::maxzpos * 16.0f)' failed.

Program received signal SIGABRT, Aborted.
#0 0x00007ffff43fed05 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
        resultvar = 0
        pid = <value optimized out>
        selftid = 7659
#1 0x00007ffff4402ab6 in abort () at abort.c:92
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x111, sa_sigaction = 0x111}, sa_mask = {__val = {140737292396174, 23028384, 140737292388058, 140737488345296, 140737291425890, 206158430232, 140737488345312, 140737488345088, 140737291337076, 206158430256, 140737488345336, 140736817887280, 140736817266720, 5, 4193823639842088488, 140737488349684}}, sa_flags = -195967270, sa_restorer = 0x15f5698}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x00007ffff43f77c5 in __assert_fail (assertion=0x15f5fa0 "unit->pos.z >= -(float3::maxzpos * 16.0f)", file=<value optimized out>, line=273, function=<value optimized out>) at assert.c:81
        buf = 0x7fffd8097830 "spring: /home/abma/dev/spring/master/rts/Sim/Units/UnitHandler.cpp:273: void CUnitHandler::Update(): Assertion `unit->pos.z >= -(float3::maxzpos * 16.0f)' failed.\n"
0000003 0x0000000000f78837 in CUnitHandler::Update (this=0x5910ec0) at /home/abma/dev/spring/master/rts/Sim/Units/UnitHandler.cpp:273
        unit = 0x7fffd81db9e0
        moveType = 0x7fffd80e1c00
        myScopedTimerFromMakro = {<BasicTimer> = {<boost::noncopyable_::noncopyable> = {<No data fields>}, name = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7fffd8158728 "Unit::MoveType::Update"}}, starttime = 292988}, autoShowGraph = false}
        usi = {_M_node = 0x7fffd81964e0}
        __PRETTY_FUNCTION__ = "void CUnitHandler::Update()"
0000004 0x000000000095c077 in CGame::SimFrame (this=0x7fffe41316a0) at /home/abma/dev/spring/master/rts/Game/Game.cpp:1510
        cputimer = {<BasicTimer> = {<boost::noncopyable_::noncopyable> = {<No data fields>}, name = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7fffd81ba0c8 "Game::SimFrame"}}, starttime = 292988}, autoShowGraph = true}
        forced = {<BasicTimer> = {<boost::noncopyable_::noncopyable> = {<No data fields>}, name = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7fffd80f9478 "Game::SimFrame (Update)"}}, starttime = 292988}, autoShowGraph = false}
0000005 0x00000000009df41b in CGame::ClientReadNet (this=0x7fffe41316a0) at /home/abma/dev/spring/master/rts/Game/NetCommands.cpp:364
        inbuf = 0x7fffe5068090 "\002{\276\344\377\177"
        dataLength = 1
        packetCode = 2 '\002'
        packet = {px = 0x7fffe53f1870, pn = {pi_ = 0x7fffe4be7b40}}
        procstarttime = 292975
        __PRETTY_FUNCTION__ = "void CGame::ClientReadNet()"
#6 0x0000000000958a8e in CGame::Update (this=0x7fffe41316a0) at /home/abma/dev/spring/master/rts/Game/Game.cpp:906
        timeNow = 292975
        difTime = 66
        dif = 0.0659999996
#7 0x00000000010261cd in SpringApp::UpdateSim (this=0x7fffffffe530, ac=0x7fffe41316a0) at /home/abma/dev/spring/master/rts/System/SpringApp.cpp:980
        ret = false
#8 0x0000000001026243 in SpringApp::Update (this=0x7fffffffe530) at /home/abma/dev/spring/master/rts/System/SpringApp.cpp:1058
        ret = 1
#9 0x0000000001026504 in SpringApp::Run (this=0x7fffffffe530, argc=6, argv=0x7fffffffe6f8) at /home/abma/dev/spring/master/rts/System/SpringApp.cpp:1162
No locals.
0000010 0x00000000010012e6 in MainFunc (argc=6, argv=0x7fffffffe6f8, ret=0x7fffffffe5dc) at /home/abma/dev/spring/master/rts/System/Main.cpp:54
        app = {cmdline = 0x1de44a0, lastRequiredDraw = 23272, static ogc = 0x0}
#11 0x00000000010015d4 in Run (argc=6, argv=0x7fffffffe6f8) at /home/abma/dev/spring/master/rts/System/Main.cpp:65
        ret = -1
        err = 0x214
0000012 0x0000000001001674 in main (argc=6, argv=0x7fffffffe6f8) at /home/abma/dev/spring/master/rts/System/Main.cpp:95
No locals.
TagsNo tags attached.
Attached Files
logs5.7z (Attachment missing)
20110731_174600_unnamed_0.82+.4.sdf (Attachment missing)
20110731_164348_unnamed_0.82+.4.sdf (Attachment missing)
screenshot.jpg (Attachment missing)
Checked infolog.txt for Errors

Relationships

has duplicate 0002517 resolvedKloot (master) desync+SIGSEGV in PathEstimator.cpp:494 

Activities

abma

2011-07-31 17:55

administrator   ~0007156

2011.07.31_16-34-13.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_16-39-20.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_16-42-53.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_16-43-41.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_16-47-38.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_16-50-10.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_16-51-07.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_16-59-59.log: CalculateCofactor<float> (m=0x7fffffffcd10, ei=3, ej=0) at /home/abma/dev/spring/master/rts/System/Matrix44f.cpp:358
2011.07.31_17-26-17.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_17-31-53.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_17-33-43.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_17-39-44.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_17-41-59.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
2011.07.31_17-45-54.log: raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64

abma

2011-07-31 17:57

administrator   ~0007157

Note: Matrix44f.cpp:358 is from Kaik, see 0002586

abma

2011-07-31 18:14

administrator   ~0007159

Last edited: 2011-07-31 18:16

an example pos:
(gdb) print unit->pos.x
$2 = 65880.7266
(gdb) print unit->pos.y
$3 = 181.863312
(gdb) print unit->pos.z
$4 = -39539.9219

static maxxpos = 4095, static maxzpos = 4095


(gdb) print unit->speed
$7 = {static binder = {class_ = 0x1de4d00, base = 0x0, flags = creg::CF_None, memberRegistrator = 0x1d85ba0, name = 0x1609a4a "float3", size = 12,
    constructor = 0x104525a <float3::_ConstructInstance(void*)>, destructor = 0x104528a <float3::_DestructInstance(void*)>, nextBinder = 0x1d85b40},
  static memberRegistrator = 0x1d85c30, static CMP_EPS = 9.99999975e-05, static NORMALIZE_EPS = 9.99999996e-13, static maxxpos = 4095, static maxzpos = 4095,
  x = 1886.7876, y = 0.0755235404, z = -1187.33984}


more/different vars needed?

Kloot

2011-07-31 18:31

developer   ~0007161

The crashes in CMatrix are again symptoms, now I need demos from games that triggered UnitHandler asserts but did not crash elsewhere (fex. 2011.07.31_17-45-54.log).

abma

2011-07-31 20:07

administrator   ~0007162

Last edited: 2011-07-31 20:31

attached hopefully the correct file (demofilename != name in log)

update: aaah, this is because the file is renamed on exit, and this isn't done because of the assert...

Kloot

2011-07-31 20:44

developer   ~0007163

Sorry, playing the demo is of no help (it does not reproduce the assertion).

Can you check if any of those other demos even crash deterministically?

abma

2011-07-31 20:46

administrator   ~0007164

Last edited: 2011-07-31 20:47

end of demo is at f=0012307 (~6:48). hm... i guess to reproduce, you need to get the same frame renderd as me and have the same viewport, when it triggered the assertion. (?)

i hope i already said: when i run my test at 30x speed, i very rarely got crashes, this is why i added the widget, that controls speed, to keep the frame-rate high, see https://github.com/spring/testmonkey/blob/master/LuaUI/Widgets/test.lua

edit: yes, will try!

abma

2011-07-31 21:07

administrator   ~0007165

Last edited: 2011-07-31 21:14

i didn't test all, i tested only the first five. only the last one crashes in about 1/5 tries or so (20110731_164348_unnamed_0.82+.4.sdf )... i ran it at 20x speed

anything that could help here: http://pastebin.com/XK2E0aYz ?

abma

2011-07-31 21:29

administrator   ~0007166

Last edited: 2011-07-31 21:34

replaying the same demo i got the same assert, but with a different unit: http://pastebin.com/SkJmE70F

(gdb) print unit->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 = 0x5b900f8 "armwar"}}
(gdb) print unit->pos
$4 = {static binder = {class_ = 0x1de4d00, base = 0x0, flags = creg::CF_None,
    memberRegistrator = 0x1d85ba0, name = 0x1609a4a "float3", size = 12,
    constructor = 0x104525a <float3::_ConstructInstance(void*)>,
    destructor = 0x104528a <float3::_DestructInstance(void*)>, nextBinder = 0x1d85b40},
  static memberRegistrator = 0x1d85c30, static CMP_EPS = 9.99999975e-05,
  static NORMALIZE_EPS = 9.99999996e-13, static maxxpos = 4095, static maxzpos = 4095,
  x = 9880.31055, y = 75952.7734, z = 65819.8984}
(gdb) print unit->speed
$5 = {static binder = {class_ = 0x1de4d00, base = 0x0, flags = creg::CF_None,
    memberRegistrator = 0x1d85ba0, name = 0x1609a4a "float3", size = 12,
    constructor = 0x104525a <float3::_ConstructInstance(void*)>,
    destructor = 0x104528a <float3::_DestructInstance(void*)>, nextBinder = 0x1d85b40},
  static memberRegistrator = 0x1d85c30, static CMP_EPS = 9.99999975e-05,
  static NORMALIZE_EPS = 9.99999996e-13, static maxxpos = 4095, static maxzpos = 4095,
  x = 266.033691, y = 2704.60474, z = 2292.21777}

so i think i can answer my question myself: not useful this info :-/

in the demo, the units seems to bump each other, see screenshot.jpg, maybe that could be the cause?

(just a guess, i try only as much info as i can)

screenshot is taken after the crash (luckily, the new opengl desktops keeps the window-contents)

Kloot

2011-07-31 21:35

developer   ~0007167

"hm... i guess to reproduce, you need to get the same frame renderd as me and have the same viewport, when it triggered the assertion."

no, the UnitHandler asserts are checked before and after each individual MoveType::Update call, and the one that triggers is on line 273 (ie. the post-update assert) so it should be synced.

"anything that could help here: http://pastebin.com/XK2E0aYz [^] ?"

yes, look closely for a specific armjanus flying outside the map :)

abma

2011-07-31 21:36

administrator   ~0007168

hu? spring stacktrace is different?

(gdb) cont
Continuing.
[f=0024452] Error: Aborted (SIGABRT) in spring 0.82+.4.0 (Debug)
[f=0024452] Error: Stacktrace:
[f=0024452] Error: <0> /lib/x86_64-linux-gnu/libc.so.6(+0x33d80) [0x7ffff43fed80]
[f=0024452] Error: <1> /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7ffff43fed05]
[f=0024452] Error: <2> /lib/x86_64-linux-gnu/libc.so.6(abort+0x186) [0x7ffff4402ab6]
[f=0024452] Error: <3> /lib/x86_64-linux-gnu/libc.so.6(__assert_fail+0xf5) [0x7ffff43f77c5]
[f=0024452] Error: <4> /home/abma/dev/spring/master/rts/Lua/LuaSyncedRead.cpp:3854
[f=0024452] Error: <5> /var/tmp/local/spring/master/bin/spring() [0x95c077]
[f=0024452] Error: <6> /var/tmp/local/spring/master/bin/spring() [0x9df41b]
[f=0024452] Error: <7> /var/tmp/local/spring/master/bin/spring() [0x958a8e]
[f=0024452] Error: <8> /home/abma/dev/spring/master/rts/Map/SM3/terrain/TerrainUtil.cpp:209
[f=0024452] Error: <9> /home/abma/dev/spring/master/rts/Map/SM3/terrain/TerrainUtil.cpp:217

(looks a bit broken...)

abma

2011-07-31 22:03

administrator   ~0007169

Last edited: 2011-07-31 22:36

aahhh! found an easy way to reproduce:


/cheat
/give 100 armjanus

let them all move to an unit in the middle of the block!

http://pastebin.com/9e0GFBGj

/cheat
/give all
/give all 1 seems to cause this:
http://pastebin.com/XDzZxQPn or a SIGFPE: http://pastebin.com/GX9RJyTj

we are back in business! ^^

abma

2011-07-31 22:45

administrator   ~0007170

Last edited: 2011-07-31 22:47

/give 100 armjanus seems to be fixed! :)

git describe
0.82.3-2989-ge6fd066

/cheat /give all 0+1 crash:
http://pastebin.com/Gz2sYXUj or the SIGFPE: http://pastebin.com/dQNzzZg0

abma

2011-07-31 23:58

administrator   ~0007171

Last edited: 2011-08-01 00:00

git describe
0.82.3-2991-g2233071

spring: /home/abma/dev/spring/master/rts/Sim/MoveTypes/GroundMoveType.cpp:638: virtual void CGroundMoveType::ImpulseAdded(const float3&): Assertion `speed.SqLength() < 1e6f' failed.


http://pastebin.com/2VadHJuq

Kloot

2011-08-01 00:21

developer   ~0007172

Last edited: 2011-08-01 00:23

Thanks, seems the problem lies in how excessive impulse values are handled (see "impulseStrength = 1000000" in the trace, that is _after_ clamping it in one my earlier commits and not even a sane value for nukes).

Kloot

2011-08-01 12:20

developer   ~0007176

Units are now killed ASAP if they exit the map with insane speeds, so the UnitHandler assertions should never trigger anymore. As a result, position coordinates can never become so large as to cause SIGFPE's in float3::SqLength etc.

Issue History

Date Modified Username Field Change
2011-07-31 17:55 abma New Issue
2011-07-31 17:55 abma File Added: logs5.7z
2011-07-31 17:55 abma Note Added: 0007156
2011-07-31 17:57 abma Note Added: 0007157
2011-07-31 17:59 abma Target Version => 0.83.0
2011-07-31 18:01 abma Relationship added has duplicate 0002517
2011-07-31 18:14 abma Note Added: 0007159
2011-07-31 18:15 abma Note Edited: 0007159
2011-07-31 18:16 abma Note Edited: 0007159
2011-07-31 18:19 abma Severity minor => crash
2011-07-31 18:31 Kloot Note Added: 0007161
2011-07-31 20:07 abma File Added: 20110731_174600_unnamed_0.82+.4.sdf
2011-07-31 20:07 abma Note Added: 0007162
2011-07-31 20:31 abma Note Edited: 0007162
2011-07-31 20:44 Kloot Note Added: 0007163
2011-07-31 20:46 abma Note Added: 0007164
2011-07-31 20:47 abma Note Edited: 0007164
2011-07-31 21:05 abma File Added: 20110731_164348_unnamed_0.82+.4.sdf
2011-07-31 21:07 abma Note Added: 0007165
2011-07-31 21:07 abma Note Edited: 0007165
2011-07-31 21:08 abma Note Edited: 0007165
2011-07-31 21:09 abma Note Edited: 0007165
2011-07-31 21:14 abma Note Edited: 0007165
2011-07-31 21:29 abma Note Added: 0007166
2011-07-31 21:30 abma File Added: screenshot.jpg
2011-07-31 21:31 abma Note Edited: 0007166
2011-07-31 21:32 abma Note Edited: 0007166
2011-07-31 21:34 abma Note Edited: 0007166
2011-07-31 21:35 Kloot Note Added: 0007167
2011-07-31 21:36 abma Note Added: 0007168
2011-07-31 22:03 abma Note Added: 0007169
2011-07-31 22:09 abma Note Edited: 0007169
2011-07-31 22:09 abma Note Edited: 0007169
2011-07-31 22:29 abma Note Edited: 0007169
2011-07-31 22:32 abma Note Edited: 0007169
2011-07-31 22:33 abma Note Edited: 0007169
2011-07-31 22:36 abma Note Edited: 0007169
2011-07-31 22:45 abma Note Added: 0007170
2011-07-31 22:47 abma Note Edited: 0007170
2011-07-31 23:58 abma Note Added: 0007171
2011-08-01 00:00 abma Note Edited: 0007171
2011-08-01 00:21 Kloot Note Added: 0007172
2011-08-01 00:23 Kloot Note Edited: 0007172
2011-08-01 12:20 Kloot Note Added: 0007176
2011-08-01 12:20 Kloot Status new => resolved
2011-08-01 12:20 Kloot Fixed in Version => 0.82.7+git
2011-08-01 12:20 Kloot Resolution open => fixed
2011-08-01 12:20 Kloot Assigned To => Kloot