RemoteTechnologiesGroup / RemoteTech

Community developed continuation of Kerbal Space Program's RemoteTech mod.
http://remotetechnologiesgroup.github.io/RemoteTech
GNU General Public License v2.0
230 stars 103 forks source link

NRE after docking #776

Closed Gordon-Dry closed 5 years ago

Gordon-Dry commented 5 years ago

With latest RT 1.9.0 and Kerbalism 2.0.1.0 dev (https://github.com/steamp0rt/Kerbalism/pull/263) I got a few instances of this after docking to another vessel:

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[RemoteTech.ISignalProcessor].get_Item (Int32 index) [0x00000] in <filename unknown>:0 
  at RemoteTech.VesselSatellite.get_SignalProcessor () [0x00000] in <filename unknown>:0 
  at RemoteTech.VesselSatellite.get_Guid () [0x00000] in <filename unknown>:0 
  at RemoteTech.API.API+<>c.<GetClosestDirectGroundStation>b__10_1 (RemoteTech.SimpleTypes.NetworkRoute`1 r) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[RemoteTech.SimpleTypes.NetworkRoute`1[RemoteTech.ISatellite]].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.IterateNullable[NetworkRoute`1] (IEnumerable`1 source, System.Func`3 selector) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.Min[NetworkRoute`1] (IEnumerable`1 source) [0x00000] in <filename unknown>:0 
  at RemoteTech.API.API.GetClosestDirectGroundStation (Guid id) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at KERBALISM.RemoteTech.NameTargetsKSC (Guid id) [0x00000] in <filename unknown>:0 
  at KERBALISM.ConnectionInfo..ctor (.Vessel v, Boolean powered, Boolean storm) [0x00000] in <filename unknown>:0 
  at KERBALISM.Vessel_info..ctor (.Vessel v, UInt32 vessel_id, UInt64 inc) [0x00000] in <filename unknown>:0 
  at KERBALISM.Cache.VesselInfo (.Vessel v) [0x00000] in <filename unknown>:0 
  at KERBALISM.Kerbalism.FixedUpdate () [0x00000] in <filename unknown>:0 

(Filename:  Line: -1)

Full log: https://www.dropbox.com/s/5x5tfsop4nrjxf9/2018-10-30_2%20KSP.log%20and%20stuff.7z?dl=1

HaullyGames commented 5 years ago

Hi team, I didn't test it yet, but looks like we have 2 differences arrays here We get a satellite from RTCore.Instance.Satellites array and then use it as index for the array RTCore.Instance.Network[satellite]. I'm not 100% familiar with RT, but looks like they are not 100% similar arrays, since I couldn't get ground station names in RTCore.Instance.Satellites. I will try to simulate this issue and find the reason.

HaullyGames commented 5 years ago

I couldn't replicate this issue. No exception so far!

KSP-TaxiService commented 5 years ago

That call surely looks like the one from EVA suit with antenna in the other issue? Same call pattern. I think we need more time to see if we can find a pattern in those NREs between Kerbalism and RT

KSP-TaxiService commented 5 years ago

I think I will have to close this issue as it can't be replicated. Do file another issue if you can find reproducible steps on the APIs.