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 entering flight scene after spending more than $(max history length) in editor with EditorTime installed #1641

Closed
ts826848 opened this issue Dec 4, 2017 · 8 comments · Fixed by #1653
Assignees
Labels
Milestone

Comments

@ts826848
Copy link
Contributor

ts826848 commented Dec 4, 2017

stderr.log:

*** Check failure stack trace: ***
    @        0x1ec82afc4  principia__ForgetAllHistoriesBefore
    @        0x1d352fef3  (unknown)
    @        0x101d25012  mono_jit_runtime_invoke
    @        0x101e4f42a  mono_runtime_invoke
    @        0x100bc2f3a  ScriptingInvocationNoArgs::Invoke()
    @        0x100bc2f09  ScriptingInvocationNoArgs::Invoke()
    @        0x100baf3fa  MonoBehaviour::CallUpdateMethod()
    @        0x10096f304  BaseBehaviourManager::CommonUpdate<>()
    @        0x100b51fbe  PlayerLoop()
    @        0x10115e6a1  -[PlayerAppDelegate UpdatePlayer]
    @     0x7fff58b10d99  __NSFireTimer
    @     0x7fff569d8464  __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
    @     0x7fff569d80e4  __CFRunLoopDoTimer
    @     0x7fff569d7bda  __CFRunLoopDoTimers
    @     0x7fff569cf3ab  __CFRunLoopRun
    @     0x7fff569ce797  CFRunLoopRunSpecific
    @     0x7fff55ce3866  RunCurrentEventLoopInMode
    @     0x7fff55ce35d6  ReceiveNextEventCommon
    @     0x7fff55ce3354  _BlockUntilNextEventMatchingListInModeWithFilter
    @     0x7fff53fe0a23  _DPSNextEvent
    @     0x7fff54775e6c  -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
    @     0x7fff53fd5831  -[NSApplication run]
    @     0x7fff53fa49d2  NSApplicationMain
    @        0x10115cfde  PlayerMain()
    @        0x100002034  start
    @                0x1  (unknown)
F1203 20:05:22.403298 3073852224 plugin.cpp:732] Check failed: t < current_time_ (-1.39020159213867402e+09 s vs. -1.39021145268293977e+09 s) 
Stacktrace:

  at (wrapper managed-to-native) principia.ksp_plugin_adapter.Interface.ForgetAllHistoriesBefore (intptr,double) <0x00073>
  at (wrapper managed-to-native) principia.ksp_plugin_adapter.Interface.ForgetAllHistoriesBefore (intptr,double) <0x00073>
  at principia.ksp_plugin_adapter.PrincipiaPluginAdapter.FixedUpdate () <0x00216>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <0x0005e>

Native stacktrace:

	0   libsystem_kernel.dylib              0x00007fff7e1a2fce __pthread_kill + 10
	1   libsystem_c.dylib                   0x00007fff7e0ff30a abort + 127
	2   principia.so                        0x00000001ec66ba85 _ZN6googleL21DumpStackTraceAndExitEv + 341
	3   principia.so                        0x00000001ec6610d9 _ZN6google10LogMessage9SendToLogEv + 937
	4   principia.so                        0x00000001ec6617c5 _ZN6google10LogMessage5FlushEv + 197
	5   principia.so                        0x00000001ec666699 _ZN6google15LogMessageFatalD2Ev + 601
	6   principia.so                        0x00000001ec662749 _ZN6google15LogMessageFatalD1Ev + 9
	7   principia.so                        0x00000001ec8ac044 _ZNK9principia10ksp_plugin15internal_plugin6Plugin24ForgetAllHistoriesBeforeERKNS_8geometry14internal_point5PointINS_10quantities19internal_quantities8QuantityINS7_10DimensionsILx0ELx0ELx1ELx0ELx0ELx0ELx0ELx0EEEEEEE + 324
	8   principia.so                        0x00000001ec82afc4 principia__ForgetAllHistoriesBefore + 148
	9   ???                                 0x00000001d352fef3 0x0 + 7840399091
	10  libmono.0.dylib                     0x0000000101d25012 mono_jit_runtime_invoke + 1766
	11  libmono.0.dylib                     0x0000000101e4f42a mono_runtime_invoke + 117
	12  KSP                                 0x0000000100bc2f3a _ZN25ScriptingInvocationNoArgs6InvokeEPP13MonoException + 42
	13  KSP                                 0x0000000100bc2f09 _ZN25ScriptingInvocationNoArgs6InvokeEv + 25
	14  KSP                                 0x0000000100baf3fa _ZN13MonoBehaviour16CallUpdateMethodEi + 234
	15  KSP                                 0x000000010096f304 _ZN20BaseBehaviourManager12CommonUpdateI21FixedBehaviourManagerEEvv + 404
	16  KSP                                 0x0000000100b51fbe _Z10PlayerLoopbbP10IHookEvent + 1262
	17  KSP                                 0x000000010115e6a1 -[PlayerAppDelegate UpdatePlayer] + 321
	18  Foundation                          0x00007fff58b10d99 __NSFireTimer + 83
	19  CoreFoundation                      0x00007fff569d8464 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
	20  CoreFoundation                      0x00007fff569d80e4 __CFRunLoopDoTimer + 1108
	21  CoreFoundation                      0x00007fff569d7bda __CFRunLoopDoTimers + 346
	22  CoreFoundation                      0x00007fff569cf3ab __CFRunLoopRun + 2427
	23  CoreFoundation                      0x00007fff569ce797 CFRunLoopRunSpecific + 487
	24  HIToolbox                           0x00007fff55ce3866 RunCurrentEventLoopInMode + 286
	25  HIToolbox                           0x00007fff55ce35d6 ReceiveNextEventCommon + 613
	26  HIToolbox                           0x00007fff55ce3354 _BlockUntilNextEventMatchingListInModeWithFilter + 64
	27  AppKit                              0x00007fff53fe0a23 _DPSNextEvent + 2085
	28  AppKit                              0x00007fff54775e6c -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
	29  AppKit                              0x00007fff53fd5831 -[NSApplication run] + 764
	30  AppKit                              0x00007fff53fa49d2 NSApplicationMain + 804
	31  KSP                                 0x000000010115cfde _Z10PlayerMainiPPKc + 638
	32  KSP                                 0x0000000100002034 start + 52

Debug info from gdb:


=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Unfortunately, I can't really provide much more info than this. It was after a fairly long play session, and the problem didn't arise again after restarting KSP. The only relevant actions I can think of was turning number of prediction steps and history length down to the minimum allowed to improve performance.

@ts826848
Copy link
Contributor Author

ts826848 commented Dec 4, 2017

Got the crash again, with more or less an identical stderr.log, after just working on a rocket in the VAB and running a few KRASH sims. Didn't touch the Principia history length/prediction steps settings; they are still at the minimum allowed.

@pleroy pleroy added the bug label Dec 4, 2017
@pleroy
Copy link
Member

pleroy commented Dec 4, 2017

I can haz journal? (Assuming of course that you manage to make it semi-reproducible.)

@ts826848
Copy link
Contributor Author

ts826848 commented Dec 4, 2017

I'm working on it. Unfortunately, I'm no closer to figuring out how to reproduce it than before, so it's likely that the first journal I can provide will be from a fairly long play session.

@ts826848
Copy link
Contributor Author

ts826848 commented Dec 4, 2017

Got a journal! It's quite large, unfortunately (about 3.2GB). I had been sitting in the VAB for some time, working on a new satellite + launcher, then the game crashed when I went to simulate.

@ts826848
Copy link
Contributor Author

ts826848 commented Dec 5, 2017

I got another journal, but it's even bigger, at 5.36GB, so I'll hold off on uploading it unless the first one doesn't help.

The crash happened again after spending some time in the VAB, then trying to start a sim. I'll start messing with that next.

@ts826848
Copy link
Contributor Author

ts826848 commented Dec 9, 2017

Got a significantly smaller journal, at ~650MB. All I did was start KSP, start building a new rocket for a Molniya orbit contract, and crash upon launching a sim.

@pleroy
Copy link
Member

pleroy commented Dec 10, 2017

I was able to reproduce the problem. As usual, thanks for the journal. Because we are in prelaunch we skip AdvanceTime, so the current time of the plugin is not set. When we enter FixedUpdate and try to forget old histories we fail a check because the plugin is still at an old time, older than the point at which the forgetting must happen.

@ts826848
Copy link
Contributor Author

I think I finally figured out how to reproduce this. It requires EditorTime and Principia to be installed:

  1. Go to the editor and create something launchable
  2. Wait for a time period longer than the max history length
  3. Launch the vessel

I tried this with Principia built from the current master (f7af30c), altered to allow max history lengths down to 128 seconds.

I don't get a crash with @eggrobin's PR.

@ts826848 ts826848 changed the title Crash on starting KRASH simulation Crash on entering flight scene after spending more than $(max history length) in editor with EditorTime installed Dec 14, 2017
@pleroy pleroy added this to the Christoffel milestone Dec 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants