Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTD after hyperjump #5554

Closed
dhouseholder opened this issue Feb 19, 2023 · 12 comments · Fixed by #5564
Closed

CTD after hyperjump #5554

dhouseholder opened this issue Feb 19, 2023 · 12 comments · Fixed by #5564

Comments

@dhouseholder
Copy link

Hello, the attached save file consistently produces a CTD when hyperjumping. Simply load the save, unpause the game, and click hyperjump to jump to the preselected system. Or try another system. The game will crash within 10 seconds after arriving. I have tested this savefile on 20230203 on Windows and Steamdeck.

vert.zip

@dhouseholder
Copy link
Author

output.txt
including output.txt

@impaktor
Copy link
Member

Info: Created shader geosphere_star (address=0x55556392ece0)

Thread 1 "pioneer" received signal SIGSEGV, Segmentation fault.
Frame::GetPositionRelTo (this=this@entry=0x55fc934b1570, relToId=...) at /home/me/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=0x55fc934b1570, relToId=...) at /home/me/usr/src/pioneer/src/Frame.cpp:352
#1  0x000055555577dc3f in Body::GetPositionRelTo (this=0x555560398d10, relToId=...) at /home/me/usr/src/pioneer/src/Body.cpp:205
#2  0x000055555577de63 in Body::GetPositionRelTo (this=<optimized out>, relTo=<optimized out>) at /home/me/usr/src/pioneer/src/Body.cpp:221
#3  0x000055555567b645 in AICmdFlyAround::TimeStepUpdate (this=0x555560d66ea0) at /home/me/usr/src/pioneer/src/ShipAICmd.cpp:1601
#4  0x00005555557ecb62 in Ship::AITimeStep (this=0x555560dbe0d0, timeStep=timeStep@entry=0.0166666675) at /home/me/usr/src/pioneer/src/Ship-AI.cpp:37
#5  0x00005555557612e2 in ShipController::StaticUpdate (this=0x555560df0dc0, timeStep=0.0166666675) at /home/me/usr/src/pioneer/src/ship/ShipController.cpp:11
#6  0x000055555566fff7 in Ship::StaticUpdate (this=0x555560dbe0d0, timeStep=0.0166666675) at /home/me/usr/src/pioneer/src/Ship.cpp:1215
#7  0x000055555568f5b3 in Space::TimeStep (this=0x555560d0e3e0, step=step@entry=0.0166666675) at /home/me/usr/src/pioneer/src/Space.cpp:1042
#8  0x00005555557a4669 in Game::TimeStep (this=0x55555d898e80, step=0.0166666675) at /usr/include/c++/12.2.1/bits/unique_ptr.h:191
#9  0x000055555563e812 in GameLoop::Update (this=0x555555be56c0, deltaTime=0.0165201146) at /home/me/usr/src/pioneer/src/Pi.cpp:944
#10 0x00005555555f3a87 in Application::Run (this=0x555555bcec00) at /home/me/usr/src/pioneer/src/core/Application.cpp:192
#11 0x00005555555d5102 in main (argc=<optimized out>, argv=<optimized out>) at /home/me/usr/src/pioneer/src/Pi.h:145

@dhouseholder
Copy link
Author

dhouseholder commented Feb 20, 2023

image
image

is there something wrong with the cargo capacity used/available on my ship?
When I first started the game I sold some equipment off for more trade cash. Not sure if that could be related.

@bszlrd
Copy link
Contributor

bszlrd commented Feb 20, 2023

No, that's intentional. The ship hase more overall capacity (equipment+cargo) than cargo hold. Simplistic way to differentiate ships. But that's subject to change in the future to a more elaborate way of handling

@dhouseholder
Copy link
Author

OK, it's just very confusing. I have 14 tons battle weapons and 2 tons hydrogen for a total of 16 tons of cargo. The ship info page says I have 8 tons cargo capacity and 0 tons used.

@bszlrd
Copy link
Contributor

bszlrd commented Feb 20, 2023

That's indeed odd. Could you open a separate issue for it?

@dhouseholder
Copy link
Author

@nozmajner opened as #5557

@Gliese852
Copy link
Contributor

Perfectly reproducible, very nice! Including in the current master.
An attempt is made to get an object with an index of ~500000 from a static array of size ~100, which, of course, leads to an access to someone else's memory.

@Gliese852
Copy link
Contributor

This is an interesting case - the NPC ship jumped into the same system as you, at the time of your jump it was already in hyperspace. Therefore, it appeared in the new system, but in its autopilot was a pointer to the body from the previous system. This will eventually crash the game.

@Gliese852
Copy link
Contributor

The fix turned out to be quite simple.
@dhouseholder In your save, there are several dozen ships in hyperclouds on exit from the system, with "bad" autopilots.
In the fixed version of the game, if you wait ~4 days, they will all disappear, and the new ships will have clean autopilots, and will not cause a crash if you jump after them. Or you can immediately jump into e.g. Gatildress, it seems no one is going there, and the game does not crash.

@zonkmachine
Copy link
Member

Duplicates?
#5242
#5258

@Gliese852
Copy link
Contributor

Indeed, these too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants