pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.62k stars 376 forks source link

Crash after hyperjump (corrupted savegame?) #5242

Closed Bodasey closed 1 year ago

Bodasey commented 3 years ago

Observed behaviour

My pioneer version (and OS):

20210723 (compile date!) from OpenSuSE 13.3 distribution Crash_log.txt

impaktor commented 3 years ago

Segfaults a few seconds after entering the system:

Thread 1 "pioneer" received signal SIGSEGV, Segmentation fault.
Frame::GetPositionRelTo (this=this@entry=0x55f6b2a1a820, relToId=...) at /home/karlf/usr/src/pioneer/src/Frame.cpp:352
352     if (m_thisId == relToId) return vector3d(0, 0, 0);
(gdb) bt
#0  Frame::GetPositionRelTo (this=this@entry=0x55f6b2a1a820, relToId=...) at /home/karlf/usr/src/pioneer/src/Frame.cpp:352
#1  0x000055555572bfff in Body::GetPositionRelTo (this=0x55555704d2d0, relToId=...) at /home/karlf/usr/src/pioneer/src/Body.cpp:146
#2  0x000055555572c243 in Body::GetPositionRelTo (this=<optimized out>, relTo=<optimized out>) at /home/karlf/usr/src/pioneer/src/Body.cpp:162
#3  0x0000555555639d7b in AICmdFlyAround::TimeStepUpdate (this=0x55556407e870) at /home/karlf/usr/src/pioneer/src/ShipAICmd.cpp:1507
#4  0x00005555557c08f4 in Ship::AITimeStep (this=0x55556406bd60, timeStep=timeStep@entry=0.0166666675) at /home/karlf/usr/src/pioneer/src/Ship-AI.cpp:37
#5  0x00005555557128c2 in ShipController::StaticUpdate (this=0x55556406cca0, timeStep=0.0166666675) at /home/karlf/usr/src/pioneer/src/ship/ShipController.cpp:11
#6  0x000055555562d243 in Ship::StaticUpdate (this=0x55556406bd60, timeStep=0.0166666675) at /home/karlf/usr/src/pioneer/src/Ship.cpp:1243
#7  0x000055555564a533 in Space::TimeStep (this=0x55555ec10bd0, step=step@entry=0.0166666675) at /home/karlf/usr/src/pioneer/src/Space.cpp:1015
#8  0x0000555555753169 in Game::TimeStep (this=0x55555fb2cf60, step=0.0166666675) at /usr/include/c++/11.1.0/bits/unique_ptr.h:173
#9  0x00005555555fb86e in GameLoop::Update (this=0x555555b868e0, deltaTime=0.0167943332) at /home/karlf/usr/src/pioneer/src/Pi.cpp:945
#10 0x00005555559748d7 in Application::Run (this=0x555555b86610) at /home/karlf/usr/src/pioneer/src/core/Application.cpp:157
#11 0x00005555555c8cb6 in main (argc=<optimized out>, argv=<optimized out>) at /home/karlf/usr/src/pioneer/src/Pi.h:147
(gdb) 
jimishol commented 3 years ago

save_crash_after_jump.gz It is a save just after jump. Game crashes after few seconds even if acceleration time is paused.

Bodasey commented 3 years ago

That is another game, i can confirm the crash, but i need to run the time to crash it. And why is jimishol's game three times bigger than mine? So much saved history?

Gliese852 commented 3 years ago

hmm, backtrace is like #5258

Web-eWorks commented 3 years ago

These should all be related to #5167, it's a dead or invalid body being serialized, loaded again, and the nullptr is not correctly being checked.

jimishol commented 2 years ago

Let me write my recent experience. I travel back and forth from A to B systems. I did ABA about 10 times. Then at arriving to B game began to crash. As walkaround I picked a nearby system C and started ACBA. After a while upon arriving to A game started to crash. So, I had to do the trips ACBCA. After a while arriving to C game started to crash. I was unable to find a nearby system D, so as to take a route ADBDA, and continued my game at some other place away from sytems A,B,C. Is it posiible crash to have to do with route? I can not answer why AB crashes at B but ACB does not. Let me add that I always save upon every succesful doking but to not end the game so as to reload it.

Bodasey commented 2 years ago

Good find - but in my game, I jumped rarely back to a system yet visited, and these jump-backs happened some jumps ago.

Gliese852 commented 2 years ago

"ABA problem"

DarioTD commented 2 years ago

Let me write my recent experience. I travel back and forth from A to B systems. I did ABA about 10 times. Then at arriving to B game began to crash. As walkaround I picked a nearby system C and started ACBA. After a while upon arriving to A game started to crash. So, I had to do the trips ACBCA. After a while arriving to C game started to crash. I was unable to find a nearby system D, so as to take a route ADBDA, and continued my game at some other place away from sytems A,B,C. Is it posiible crash to have to do with route? I can not answer why AB crashes at B but ACB does not. Let me add that I always save upon every succesful doking but to not end the game so as to reload it.

Thanks this solved a crash I was having in 2022-02-03 version I tried another "start in mars" to try the route from A to B and it worked so it probably has to do with the saved game file maybe file corruption or how it saves data idk I am not a developer :(

Bodasey commented 1 year ago

meanwhile invalid save format, not observed any more - other reasons to keep this open?

Web-eWorks commented 1 year ago

I've run into this issue as well without any saves made at all, or jumping back to old systems. Not entirely sure what's the root cause, but it's the same expression of the crash. Leaving this open for now.