ferram4 / Ferram-Aerospace-Research

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

NRE Spam in Certain Flight Modes after Flight Loaded from Tracking Station #102

Closed toadicus closed 6 years ago

toadicus commented 9 years ago

Found what may be a FAR bug when loading up my (moderately-heavily modded) career save with Glauert last night. In general, it looks like a failure during FARGUI startup (perhaps a race with FARSettingsScenarioModule construction specifically) is cascading into various bits of the GUI which eventually results in per-physics update NRE spam.

Lightly-pruned log file here: http://ksp.hawkbats.com/20150713-KSP_log-FAR-NRE.xz

HTH

ferram4 commented 9 years ago

Can't reproduce just loading up a craft. Need more specific reproduction steps.

toadicus commented 9 years ago

Full conditions go something like this:

This seems like something that probably isn't easily reproducible without a pre-existing condition that exhibits the problem. I can't reproduce it in a simple way either.

That said, it seems pretty clear that it is a race condition, given that:

Since ScenarioModule startup and VesselModule startup are probably both invoked via coroutines (or perhaps just arbitrarily depending on the order and expediency with which Squad adds the MonoBehaviours), there is no guarantee of orderly startup in a situation containing many such items.

If you'd prefer, I can try to provide more specific steps by removing mods until the problem doesn't happen. But, I'd wager the problem is actually related to the number of mods using either ScenarioModule or VesselModule objects and not to the mods themselves.

FWIW, the follow mods in my install use ScenarioModules:

./KerbalConstructionTime/plugins/KerbalConstructionTime.dll
./TriggerTech/KerbalAlarmClock/KerbalAlarmClock.dll
./UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll
./FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll
./AsteroidDay/SentinelMission.dll

These ones use VesselModules:

./ModularFlightIntegrator/ModularFlightIntegrator.dll
./FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll
toadicus commented 9 years ago

Found another piece of the puzzle looking back over the log. Turns out, that specific load in question completely skipped the SpaceCentre/TrackingStation scenes, meaning FARSettingsScenarioModule hadn't had its usual chance to set instance before Flight. I think I had restored something from a hacked-up quicksave after a different mod issue or something; I'd forgotten that detail.

Guessing that's probably a somewhat more-esoteric circumstance than you really need to support; I'll verify tonight if the problem disappears after a normal Menu->SpaceCentre->[Other]->Flight startup sequence.

ferram4 commented 6 years ago

Since I haven't been able to reproduce this in a long time, I'm assuming that this has likely been fixed somewhere along the way, and so I'm closing this issue.