Andrettin / Wyrmsun

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

An other crash #45

Closed a-detiste closed 8 years ago

a-detiste commented 8 years ago

I got a crash, it's not the first time (maybe second of third in hours of play); but this time I took the time to save the log. The autosave is quite usefull ! I lost almost nothing on my progess.

log.zip

a-detiste commented 8 years ago

I can reload the autosave then got attacked by 30 fighters & 3 balista like 30 seconds later; then I loose because I was overconfident & didn't built a big enough army. So this save would be only usefull for debugging purpose.

Maybe there was an overflow somewhere when IA decide to attack with all units at once.

Andrettin commented 8 years ago

Thanks! Unfortunately, I couldn't find anything in the log or autosave that would shed light as to why the crash happened =/

a-detiste commented 8 years ago

I experienced this one too: https://github.com/Andrettin/Wyrmsun/commit/d157aa21f79b63642a4cebfa3aa86c25a7bac792

But this is fixed now

a-detiste commented 8 years ago

Hi again,

I've never used a debugger (even thought I had an IT bachelor 10 years from a lame school in the rust belt); so I'm just giving it a try:

This happens on a Scandinavia custom map where I start with 2 worker & 2 fighter. Crash happens when I came too close to early enemy's base and pick up a fight with enemy's 2 fighter.

Same crash happened on previous try with the tribe from the east (what looks like Finland)

https://github.com/Andrettin/Wyrmgus/blob/c2bf45cc9a5498f4f1624c28f510f7e78216c161/src/unit/unit.cpp#L3580

$ gdb wyrmsun64 core
...
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./wyrmsun64'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000789d7f in CUnit::GetLayerOffset(int, int) const ()
[Current thread is 1 (Thread 0x7f5ca0db5740 (LWP 17177))]
(gdb) where
#0  0x0000000000789d7f in CUnit::GetLayerOffset(int, int) const ()
#1  0x00000000007939dc in CUnit::Draw(CViewport const&) const ()
#2  0x000000000061dae9 in CViewport::Draw() const ()
#3  0x00000000006bbf9e in DrawMapArea() ()
#4  0x00000000006bc03a in UpdateDisplay() ()
#5  0x00000000006bd548 in DisplayLoop() ()
#6  0x00000000006bd55a in SingleGameLoop() ()
#7  0x00000000006bd801 in GameMainLoop() ()
Log( { GameCycle = 4665, GameTimeOfDay = 5, UnitNumber = 22, UnitIdent = "unit-germanic-warrior", Action = "move", Flush = 1, PosX = 40, PosY = 45, SyncRandSeed = -42494109 } )
Log( { GameCycle = 4665, GameTimeOfDay = 5, UnitNumber = 20, UnitIdent = "unit-germanic-warrior", Action = "move", Flush = 1, PosX = 40, PosY = 45, SyncRandSeed = -42494109 } )
Log( { GameCycle = 4690, GameTimeOfDay = 5, UnitNumber = 22, UnitIdent = "unit-germanic-warrior", Action = "move", Flush = 1, PosX = 41, PosY = 43, SyncRandSeed = -859415880 } )
Log( { GameCycle = 4690, GameTimeOfDay = 5, UnitNumber = 20, UnitIdent = "unit-germanic-warrior", Action = "move", Flush = 1, PosX = 41, PosY = 43, SyncRandSeed = -859415880 } )
Andrettin commented 8 years ago

Thank you, that was very helpful :)

Fixed the crash: https://github.com/Andrettin/Wyrmgus/commit/fc5d0e0b9945f166b1d0e8f3c637f4b185810362

I've released a new version (1.8.5) with the fix.