DarkMultiPlayer Client

DarkMultiPlayer Client

38.8k Downloads

NRE crash at Vessel.recurseCoMs at VesselWorker.CheckVesselParts

oldmud0 opened this issue ยท 4 comments

commented

My plane crashed and I bailed my kerbal out at the last moment. There was also some activity going on in the background coming from other players (big explosions, rockets launching). Right when I bailed, my game froze and this was spammed over and over in the log:

[LOG 13:24:38.777] [1417.823] DarkMultiPlayer: Threw in UpdateEvent, exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Vessel.recurseCoMs (.Part part) [0x00000] in <filename unknown>:0 
  at Vessel.findLocalCenterOfMass () [0x00000] in <filename unknown>:0 
  at ProtoVessel..ctor (.Vessel VesselRef) [0x00000] in <filename unknown>:0 
  at Vessel.BackupVessel () [0x00000] in <filename unknown>:0 
  at DarkMultiPlayer.VesselWorker.CheckVesselParts (.Vessel checkVessel) [0x00000] in <filename unknown>:0 
  at DarkMultiPlayer.VesselWorker.SendVesselUpdateIfNeeded (.Vessel checkVessel) [0x00000] in <filename unknown>:0 
  at DarkMultiPlayer.VesselWorker.SendVesselUpdates () [0x00000] in <filename unknown>:0 
  at DarkMultiPlayer.VesselWorker.Update () [0x00000] in <filename unknown>:0 
  at DarkMultiPlayer.Client.Update () [0x00000] in <filename unknown>:0 
[EXC 13:24:38.795] NullReferenceException: Object reference not set to an instance of an object
    FlightIntegrator.FixedUpdate ()
[EXC 13:24:38.798] NullReferenceException: Object reference not set to an instance of an object
    Vessel.recurseCoMs (.Part part)
    Vessel.findWorldCenterOfMass ()
    Vessel.FixedUpdate ()

Not sure what went wrong there, but my reliability record with DMP is atrocious. ๐Ÿ˜’

commented

This looks like standard unity/KSP weirdness - Some of the vessel got destroyed but the vessel didn't update properly and contains a few null parts.

You can see KSP tripping balls as well, which are the "[EXC]" lines.

DMP catches and logs these errors as letting them bubble up into KSP causes many problems for it. This may be a DMP problem, but I suspect a similar type of thing could happen in stock... It mainly depends on who threw the first exception.

commented

Hmm. Can we check parts for nullness just to hack around these KSP part bugs?

commented

It threw on this line here:

ProtoVessel checkProto = checkVessel.BackupVessel();

Basically, BackupVessel returns vessel.protoVessel if it's packed, or uses the new Protovessel(vessel) constructor if it's unpacked, as is the case here. While this may be possible to work around (by try catching the BackupVessel call), I think KSP would already be having kittens by this point, so we'll need to look into what causes it.

I'm almost certain this is a stock bug that DMP is tickling.

commented

Okay, I'll close this until somebody can prove that DMP is actually tickling KSP.