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

Crash on camera switching from Sun to vessel with extremely large velocity/altitude #1595

Closed
ts826848 opened this issue Oct 12, 2017 · 3 comments
Labels
Milestone

Comments

@ts826848
Copy link
Contributor

From #principia:

04:08 < awang> egg|work|egg: I have an interesting bug for you
04:09 < awang> Looking in the tracking station, see a sounding rocket core some absurd
               distance from the Earth
04:10 < awang> 242.189Tm, moving at 596.5Mm/s
04:10 < awang> Click "fly", go to map view, Sun isn't visible
04:10 < awang> Hit tab, camera goes to sun
04:10 < awang> Hit backquote to reset camera, crash in Principia
04:11 < awang> https://hastebin.com/raw/qelasunita
04:13 < awang> INFO file is here:
               https://www.dropbox.com/s/c8b2mfd2skq9iyp/INFO.20171011-180038.310?dl=0
04:13 < awang> Don't know if this is something to worry about, since the circumstances
               are probably somewhat uncommon

Save is here. Don't know if it'll work, since my game is heavily modded. The ship in question should be "Proc Sounding Rocket 1"

@pleroy pleroy added the bug label Oct 14, 2017
@ts826848
Copy link
Contributor Author

Alright, got another crash. This time, KSP didn't crash immediately upon resetting the camera from the Sun back to the vessel, but it eventually crashed after jumping between the Sun, Mercury (hit tab one time too many a few times), and the vessel in map mode, as well as switching in and out of map mode.

Stack trace:

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff50223fce __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff50361150 pthread_kill + 333
2   libsystem_c.dylib             	0x00007fff5018032a abort + 127
3   libmono.0.dylib               	0x0000000101d91c38 mono_handle_native_sigsegv + 726
4   libmono.0.dylib               	0x0000000101ddb29d sigabrt_signal_handler + 97
5   libsystem_platform.dylib      	0x00007fff50354f5a _sigtramp + 26
6   ???                           	0x000060000014b0b0 0 + 105553117622448
7   libsystem_c.dylib             	0x00007fff5018032a abort + 127
8   principia.so                  	0x00000002acb1ccc5 google::DumpStackTraceAndExit() + 341
9   principia.so                  	0x00000002acb14a3a google::LogMessage::Fail() + 10
10  principia.so                  	0x00000002acb13918 google::LogMessage::SendToLog() + 936
11  principia.so                  	0x00000002acb13f3c google::LogMessage::Flush() + 188
12  principia.so                  	0x00000002acb18bd9 google::LogMessageFatal::~LogMessageFatal() + 601
13  principia.so                  	0x00000002acb14de9 google::LogMessageFatal::~LogMessageFatal() + 9
14  principia.so                  	0x00000002ac9f9fda principia::physics::internal_continuous_trajectory::ContinuousTrajectory<principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true> >::EvaluatePosition(principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&) const + 506
15  principia.so                  	0x00000002aca007c1 void principia::physics::internal_ephemeris::Ephemeris<principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true> >::ComputeGravitationalAccelerationByMassiveBodyOnMasslessBodies<true>(principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&, principia::physics::internal_massive_body::MassiveBody const&, unsigned long, std::__1::vector<principia::geometry::internal_point::Point<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> >, std::__1::allocator<principia::geometry::internal_point::Point<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> > > > const&, std::__1::vector<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1>, std::__1::allocator<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> > >&) const + 49
16  principia.so                  	0x00000002aca005c0 principia::physics::internal_ephemeris::Ephemeris<principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true> >::ComputeMasslessBodiesGravitationalAccelerations(principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&, std::__1::vector<principia::geometry::internal_point::Point<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> >, std::__1::allocator<principia::geometry::internal_point::Point<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> > > > const&, std::__1::vector<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1>, std::__1::allocator<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> > >&) const + 224
17  principia.so                  	0x00000002aca00342 principia::physics::internal_ephemeris::Ephemeris<principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true> >::ComputeMasslessBodiesTotalAccelerations(std::__1::vector<std::__1::function<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> (principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&)>, std::__1::allocator<std::__1::function<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> (principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&)> > > const&, principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&, std::__1::vector<principia::geometry::internal_point::Point<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> >, std::__1::allocator<principia::geometry::internal_point::Point<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> > > > const&, std::__1::vector<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1>, std::__1::allocator<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> > >&) const + 66
18  principia.so                  	0x00000002ac945312 principia::integrators::internal_embedded_explicit_runge_kutta_nyström_integrator::EmbeddedExplicitRungeKuttaNyströmIntegrator<principia::geometry::internal_point::Point<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> >, 4, 3, 4, true>::Instance::Solve(principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&) + 2930
19  principia.so                  	0x00000002ac9f6bba principia::physics::internal_ephemeris::Ephemeris<principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true> >::FlowWithAdaptiveStep(principia::base::not_null<principia::physics::internal_discrete_trajectory::DiscreteTrajectory<principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true> >*>, std::__1::function<principia::geometry::internal_grassmann::Multivector<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<1ll, 0ll, -2ll, 0ll, 0ll, 0ll, 0ll, 0ll> >, principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true>, 1> (principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&)>, principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&, principia::physics::internal_ephemeris::Ephemeris<principia::geometry::internal_frame::Frame<principia::serialization::Frame_PluginTag, (principia::serialization::Frame_PluginTag)7, true> >::AdaptiveStepParameters const&, long long, bool) + 2090
20  principia.so                  	0x00000002aca2fea3 principia::ksp_plugin::internal_vessel::Vessel::FlowPrediction(principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&) + 339
21  principia.so                  	0x00000002aca2fd07 principia::ksp_plugin::internal_vessel::Vessel::UpdatePrediction(principia::geometry::internal_point::Point<principia::quantities::internal_quantities::Quantity<principia::quantities::internal_quantities::Dimensions<0ll, 0ll, 1ll, 0ll, 0ll, 0ll, 0ll, 0ll> > > const&) + 231
22  principia.so                  	0x00000002ac9cdbf6 principia::ksp_plugin::internal_plugin::Plugin::UpdatePrediction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const + 70
23  principia.so                  	0x00000002ac962de8 principia__UpdatePrediction + 136
24  ???                           	0x000000020f459c08 0 + 8846154760
25  ???                           	0x0000000111f678af 0 + 4596332719
26  libmono.0.dylib               	0x0000000101d25012 mono_jit_runtime_invoke + 1766
27  libmono.0.dylib               	0x0000000101e4f42a mono_runtime_invoke + 117
28  unity.Squad.Kerbal Space Program	0x0000000100bc2f3a ScriptingInvocationNoArgs::Invoke(MonoException**) + 42
29  unity.Squad.Kerbal Space Program	0x0000000100bc2f09 ScriptingInvocationNoArgs::Invoke() + 25
30  unity.Squad.Kerbal Space Program	0x0000000100baf3fa MonoBehaviour::CallUpdateMethod(int) + 234
31  unity.Squad.Kerbal Space Program	0x000000010096f304 void BaseBehaviourManager::CommonUpdate<FixedBehaviourManager>() + 404
32  unity.Squad.Kerbal Space Program	0x0000000100b51fbe PlayerLoop(bool, bool, IHookEvent*) + 1262
33  unity.Squad.Kerbal Space Program	0x000000010115e6a1 -[PlayerAppDelegate UpdatePlayer] + 321
34  com.apple.Foundation          	0x00007fff2ac0cd99 __NSFireTimer + 83
35  com.apple.CoreFoundation      	0x00007fff28ad82d4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
36  com.apple.CoreFoundation      	0x00007fff28ad7f54 __CFRunLoopDoTimer + 1108
37  com.apple.CoreFoundation      	0x00007fff28ad7a4a __CFRunLoopDoTimers + 346
38  com.apple.CoreFoundation      	0x00007fff28acf21b __CFRunLoopRun + 2427
39  com.apple.CoreFoundation      	0x00007fff28ace607 CFRunLoopRunSpecific + 487
40  com.apple.HIToolbox           	0x00007fff27de3866 RunCurrentEventLoopInMode + 286
41  com.apple.HIToolbox           	0x00007fff27de35d6 ReceiveNextEventCommon + 613
42  com.apple.HIToolbox           	0x00007fff27de3354 _BlockUntilNextEventMatchingListInModeWithFilter + 64
43  com.apple.AppKit              	0x00007fff260e09f7 _DPSNextEvent + 2085
44  com.apple.AppKit              	0x00007fff26875d98 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
45  com.apple.AppKit              	0x00007fff260d5805 -[NSApplication run] + 764
46  com.apple.AppKit              	0x00007fff260a49a6 NSApplicationMain + 804
47  unity.Squad.Kerbal Space Program	0x000000010115cfde PlayerMain(int, char const**) + 638
48  unity.Squad.Kerbal Space Program	0x0000000100002034 start + 52

stderr.log
journal

@eggrobin
Copy link
Member

The actual check in the failure above (from the stderr) is

F1014 08:03:02.429422 2303124288 continuous_trajectory_body.hpp:153] Check failed: t_max() >= time (-1.07365920000000000e+09 s vs. -1.07365919999999988e+09 s) 

@pleroy
Copy link
Member

pleroy commented Oct 14, 2017

This was a tough one to analyze, and your journal was absolutely critical, thanks a lot for taking the time to record it and send it to us.

There is a subtle bug in the integrator used to compute the prediction, which causes us to lose a small amount of accuracy when computing the times at which the integration takes place. Normally this would be invisible, but since your vessel is very far from the Sun and very fast (twice the speed of light?!) the trajectory is nearly a straight line and that makes the integration time overshoot (by one ulp) the time up to which the solar system was integrated.

I'll send a PR soon. The fix won't be in Chasles, since we already cut that release. It will be in 陈景润, to be released on November 18th.

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

No branches or pull requests

3 participants