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

About last version of KOS & KPM Test report #2888

Open
Massetstephane opened this issue Mar 8, 2021 · 9 comments
Open

About last version of KOS & KPM Test report #2888

Massetstephane opened this issue Mar 8, 2021 · 9 comments

Comments

@Massetstephane
Copy link

Massetstephane commented Mar 8, 2021

HI !
I conducted some test with the new version kOSPropMonitor-1.7.2.29290 & kOS-v1.3.2.0
I'm working on a stock installation by adding as and when KOS - KPM
So I launched a first time without my script folder.
in log we have this :
[EXC 11:15:08.036] ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0) System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0) kOS.Screen.Interpreter.IsWaitingForCommand () (at <3ccb18ebae2a49929054690a1a176760>:0) kOS.Screen.TermWindow.ProcessUnconsumedInput () (at <3ccb18ebae2a49929054690a1a176760>:0) kOS.Screen.TermWindow.Update () (at <3ccb18ebae2a49929054690a1a176760>:0) UnityEngine.DebugLogHandler:LogException(Exception, Object) ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object) UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
But it's work ! (button label, with my library it's perfect added after the first test)
And I know why at starting the buttons of the mfd does not work at the first start, the default page of the monitor mfdKOS does not have the handler page with Kosmonitor, so when the script in Boot launches addons:KPM is not taken into account.

It's OK . (I'll have to choose between two option a single page on the MFDKOS or not use addons:kpm in the script boot.)
steph.

@Dunbaratu
Copy link
Member

I literally have no idea what I'm supposed to do with this information.

@Massetstephane
Copy link
Author

Massetstephane commented Mar 10, 2021

hi ! sorry !!
Ah yes forgot the log file, in fact i have this message error but is not a problem for now.
For my page problem it's KPM concerned not kos.
I'm going to give back a log file.
Steph.
last version . KOS & KPM
KSP.log

@JonnyOThan
Copy link
Contributor

FWIW I've seen this same exception when not using KPM, but I don't have a good repro case. I'll keep an eye out for it.

@Massetstephane
Copy link
Author

@JonnyOThan , ok .
I don't know if has an impact on the game, I would have to play a game for good, I spend more time tampering with KSP than doing games. I have a save (career) well advanced in 1.10 but with a lot of Mod not yet compatible in 1.11.1

@StoneBlue
Copy link
Contributor

I am also seeing this same exact stream of exceptions upon craft launch from the editor. WITHOUT, having kOS Prop Monitor ever installed.

Heres link to my forum post on the thread about it, with links to log and gamedata screenshot:
https://forum.kerbalspaceprogram.com/index.php?/topic/165628-ksp-1101-and-111-kos-v1310-kos-scriptable-autopilot-system/&do=findComment&comment=3940645

@Dunbaratu
Copy link
Member

Dunbaratu commented Mar 15, 2021

Sigh. It doesn't appear on my install, which means it might be a race condition that only happens if the startup callback hooks happen in a particular order. (Something trying to start running its Update() logic before all the pieces it needs have finished loading in.) I hope not. Those are darn near impossible to diagnose.

Does the exception only happen once when you first launch the vessel, or does it keep spamming the log multiple times a second?

@StoneBlue
Copy link
Contributor

StoneBlue commented Mar 16, 2021

Once, immediately... but a constant burst, that lasts maybe 5~10 seconds, then stops. I get exceptions from other mods interspersed during this time, that seem related, which I dont get without a kOS part attached. I'll test further on a fresher install, with less mods installed.. not that there's that many now.

@mgalyean
Copy link

I get a very similar stream of errors, fwiw. Seems mostly harmless in the contextual soup of unity/mono/ksp bad index, null object, not found errors. Though I am convinced that if the devs involved found ways to avoid generating these errors the dynamic state of the game would be far more stable. A null object reference can only happen under certain circumstances and all of them are avoidable and avoiding them is desirable as relying of underlying corner-case error trapping is never a good idea as it almost certainly was not tested a well as the main pathways and it is in those corners that testing doesn't travel to much that slow memory leaks and conditional segmentation errors lurk. Ok, off soap box. But did want to mention that I get a very similar string of errors and do not have KPM installed, but do have RPM installed. So maybe it is RPM related as I assume OP has that installed if OP had KPM installed

@Dunbaratu
Copy link
Member

Alright, even though I can't make the error show up, I can tell from the stack trace you posted that there's really only one possible line that could be throwing that particular exception, and it's this one:

return !locked && context.Program[context.InstructionPointer] is OpcodeEOF;

The index out of range has to be coming from context.InstructionPointer being out of range for the context.Program array.

If you have access to a dev environment to compile kOS, you could try putting a debug logging line just before that line to print out what is context.Program.Count() and what is context.InstructionPointer just before the return line.

It's possible something is trying to start up here before the context.Program has been initialized, and thus it has zero items in it (such that any value of context.InstructionPointer would be out of range.)

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

No branches or pull requests

5 participants