ferram4 / Ferram-Aerospace-Research

Aerodynamics model for Kerbal Space Program
Other
239 stars 131 forks source link

NRE when picking up control surface in SPH #11

Closed jakkarth closed 10 years ago

jakkarth commented 10 years ago

Using the DLL found in the current repository from 9 days ago, when I pick up a control surface to attach it to my plane, I get the following in my error log:

NullReferenceException: Object reference not set to an instance of an object at ferram4.FARControllableSurface.OnStart (StartState state) [0x00000] in :0 at Part.ModulesOnStart () [0x00000] in :0 at Part+.MoveNext () [0x00000] in :0

To reproduce this, I click on SPH, choose the Probodobodyne OKTO2 probe core, then switch to the aerodynamics tab and click on the advanced canard. I do not have to place the part onto the craft, simply pressing the button in the part list is sufficient.

Things get worse if I choose a pWing control surface (using pWings 0.8.1):

NullReferenceException: Object reference not set to an instance of an object at ferram4.FARControllableSurface.OnStart (StartState state) [0x00000] in :0 at WingManipulator.CalculateAerodynamicValues () [0x00000] in :0 at WingManipulator.OnStart (StartState state) [0x00000] in :0 at Part.ModulesOnStart () [0x00000] in :0 at Part+.MoveNext () [0x00000] in :0

When I attempt to attach the pWing control surface, it doesn't "stick", and when I throw it away I get these errors scrolling on forever:

NullReferenceException at (wrapper managed-to-native) UnityEngine.Component:InternalGetTransform () at UnityEngine.Component.get_transform () [0x00000] in :0 at ferram4.FARWingAerodynamicModel.WingExposureFunction () [0x00000] in :0 at ferram4.FARWingAerodynamicModel.RunExposure () [0x00000] in :0 at (wrapper delegate-invoke) Callback:invoke_voidthis () at (wrapper delegate-invoke) Callback:invoke_voidthis () at ferram4.FARPartModule.ForceOnVesselPartsChange () [0x00000] in :0 at ferram4.FARGlobalControlEditorObject.LateUpdate () [0x00000] in :0

NullReferenceException at (wrapper managed-to-native) UnityEngine.Component:GetComponent (System.Type) at UnityEngine.Component.GetComponent[FARWingAerodynamicModel] () [0x00000] in :0 at ferram4.FAREditorGUI.Update () [0x00000] in :0 at ferram4.FAREditorGUI.OnGUI () [0x00000] in :0 at (wrapper delegate-invoke) Callback:invoke_voidthis () at RenderingManager.OnGUI () [0x00000] in :0

at which point the name field at the top of the interface disappears and clicking no longer works, necessitating an alt+F4 exit.

A full log is available at http://silenttosaturn.com/kspsave/farbug2.txt

I apologize if this is actually a bug in something else such as pWings and it just happens to become visible through log messages relating to FAR. As always, thanks for a great mod and your incredible patience when it comes to dealing with end users who don't always understand what's going on.

jakkarth commented 10 years ago

I've confirmed that the problems listed above do not apply to the released version 0.14.1.1, only to the dll available in the repo. For now I'm living with the "gui disappears when right-click-dragging" bug instead of the "crash ksp when attaching control surfaces" bug.

ferram4 commented 10 years ago

The NRE has been confirmed and is fixed in my build, I'm going to leave this open until I push the fix (since there are some dependency issues I need to resolve first).

Regardless, none of those should cause KSP to crash. I assume you were using 32-bit KSP to reproduce the crash issue, since 64-bit is known to be quite unstable.

jakkarth commented 10 years ago

It doesn't crash so much as the gui fails to update and clicking doesn't do anything anymore. The game continues to run, kerbals walking around the SPH floor and so on, but with the NRE inside OnGUI the rest of the gui fails to draw or respond to events. I am running it on 64bit on Linux.

ferram4 commented 10 years ago

Ah. That's not a crash then.

Okay, I've heard that 64bit Linux is magically more stable than win64, so that should be fine. I'll double-check with pWings to make sure there are no issues there on my side.

jakkarth commented 10 years ago

Thanks as always! I'm looking forward to the next update.

ferram4 commented 10 years ago

This NRE should have been squashed now.