Open lpgagnon opened 3 years ago
Decoded stack trace:
https://github.com/mockingbirdnest/Principia/blob/c0f911dc0e301755abf8847c656c264ed234c64a/ksp_plugin/interface_flight_plan.cpp#L492-L498 https://github.com/mockingbirdnest/Principia/blob/c0f911dc0e301755abf8847c656c264ed234c64a/ksp_plugin/flight_plan.cpp#L169-L199 https://github.com/mockingbirdnest/Principia/blob/c0f911dc0e301755abf8847c656c264ed234c64a/ksp_plugin/flight_plan.cpp#L395-L407 https://github.com/mockingbirdnest/Principia/blob/c0f911dc0e301755abf8847c656c264ed234c64a/ksp_plugin/flight_plan.cpp#L385-L385 https://github.com/mockingbirdnest/Principia/blob/c0f911dc0e301755abf8847c656c264ed234c64a/physics/ephemeris_body.hpp#L458-L474 https://github.com/mockingbirdnest/Principia/blob/c0f911dc0e301755abf8847c656c264ed234c64a/physics/ephemeris_body.hpp#L1166-L1200The log also has suspicious messages like:
I1101 12:07:26.290994 7936 flight_plan.cpp:320] Loading a flight plan with 1 anomalous segments and status FAILED_PRECONDITION: At time -1.24250734787396073e+09 s, step size is effectively zero. Singularity or stiff system suspected.
E1101 13:29:51.749092 15952 interface_body.hpp:479] At time -1.24250735927222538e+09 s, step size is effectively zero. Singularity or stiff system suspected.
I believe that the check tells us that Ephemeris::FlowODEWithAdaptiveStep
is called with a t
that is strictly less than the end time of the trajectory. (Note the word "believe", the logic there is a bit tricky.)
We are called from FlightPlan::Replace
, replacing a manœuvre in the flight plan because the user clicked "instant impulse". We do not know exactly the shape of the flight plan at the time of the crash or the manœuvre being replaced, but the last time the flight plan was loaded it was anomalous, and therefore was printed out. It looked like this (times in second since J2000):
initial_time: -1242512439.579787
desired_final_time: -1242504055.6769223
manœuvre 0:
initial_time: -1242510250.6003575
final_time: -1242510235.6185611
duration: 14.981796301479443
manœuvre 1:
initial_time: -1242508622.9597487
final_time: -1242508362.7189230
duration: 260.24082569420426
manœuvre 2:
initial_time: -1242508362.7179232
final_time: -1242508262.5189014
duration: 100.19902178449944
It is worth noting that the last segment is anomalous. The last time the flight plan is integrated a singularity is encountered at time -1242507359.27226591
so the desired final time is not reached (presumably, the flight plan goes through the centre of a planet). Also interesting is the fact that the last two manœuvres are very close, being separated by 1 ms.
The t_final
passed to the integrator is 1242508362.71792316
which matches the initial time of manœuvre 2 to the last digit. This tells us that we are recomputing the coast that ends at the beginning of that manœuvre. However, the end of the trajectory being prolonged (which should be at the fork point of the coast ending at manœuvre 2, i.e., the end of manœuvre 1) is -1242508358.39303112
(4 seconds into manœuvre 2). All of this points at a bug in the replacement of manœuvres, but it's hard to be more specific.
Two questions for @lpgagnon:
Scenario: in low orbit around the moon, plotting maneuvers for a landing. Had just quickloaded, and noticed plotted trajectory didn't quite match what it was prior to quicksave. Started fiddling with things to see if it was just a refresh issue. Last thing I did was click "instant impulse", game froze, then CTD.
zipped INFO.log