Jump to content

Need a help on a KSP bug I am dealing with


Recommended Posts

As usual, reproduce the problem and then quit KSP. Look for a file called KSP.log in the same place where the KSP executable is and publish it on Dropbox, googl4le drive or similar and then post the link here.

With a bit of luck, the log will pinpoint what's going on.

Link to comment
Share on other sites

18 hours ago, exospaceman said:

It's been 3 days since this bug started to occur on the game and I can't seem to get rid of it, If you can help me out I would appreciate it.

That usually means there was some sort of exception, possibly caused by a corrupted game.  I tried downloading the file, had to request permission

Link to comment
Share on other sites

4 minutes ago, exospaceman said:

I shared see if it works?

That worked.

Ok, just an FYI, for this sort of issue, the Player.log would have been better.

That being said, there are a lot of NullRef exceptions from Atmosphere, and I think that this is what's causing the problems:

[ERR 09:59:33.193] Exception handling event onGameSceneLoadRequested in class CloudsPQS:System.NullReferenceException: Object reference not set to an instance of an object
  at Atmosphere.CloudsPQS.SceneLoaded (GameScenes scene) [0x00056] in <b16df1348f62435f9da569c4f46cc9f7>:0 
  at EventData`1[T].Fire (T data) [0x000b0] in <4b449f2841f84227adfaad3149c8fdba>:0 

Also, this is concerning:

[ERR 10:01:06.145] [Scatterer][Error] Destroying duplicate instance, check your install for duplicate scatterer folders, or nested GameData folders

Have you tried it with a new save?

Link to comment
Share on other sites

4 hours ago, linuxgurugamer said:
ERR 09:59:33.193] Exception handling event onGameSceneLoadRequested in class CloudsPQS:System.NullReferenceException: Object reference not set to an instance of an object
  at Atmosphere.CloudsPQS.SceneLoaded (GameScenes scene) [0x00056] in <b16df1348f62435f9da569c4f46cc9f7>:0 
  at EventData`1[T].Fire (T data) [0x000b0] in <4b449f2841f84227adfaad3149c8fdba>:0 

 

4 hours ago, linuxgurugamer said:
[ERR 10:01:06.145] [Scatterer][Error] Destroying duplicate instance, check your install for duplicate scatterer folders, or nested GameData folders

 

4 hours ago, linuxgurugamer said:

Have you tried it with a new save?

Well I did made a new save in the same game data

Link to comment
Share on other sites

53 minutes ago, exospaceman said:

I am sorry for all the confusion guys I am trying to figure how to fix this out

Before anything else, make a FULL BACKUP of the whole KSP. Not a link, not a move, be sure to do a FULL COPY.

O suggest to copy the thing into your Desktop to make easier to reach the files.

Then, whatever you do, you do in the copy. If things screwed, then you delete the copy and do another backup to Desktop, and then start again.

I'm a maniac archivist :) I have backups of every single KSP gaming session I ever had (another day I fired up my old 1.4.3 one with some pretty old savegames just fo the nostalgia). :P

I suggest you do the same.

In the mean time, I'm giving a peek on your Player log.

— — — 

On 7/26/2023 at 9:58 PM, exospaceman said:

It's been 3 days since this bug started to occur on the game and I can't seem to get rid of it, If you can help me out I would appreciate it.

I need some information to help me look on the thing with the proper mindset.

Do you remember running CKAN between the last time the game worked and the first time it started to bork?

If you don't use CKAN, do you remember installing something new (anything) instead?

I had diagnosed rigs similar to yours without these exact Exceptions I found in your rig, I'm finding somewhat weird things that I know works breaking on your rig without apparent reason - but my suspicions goes to a direction in which the diagnosing is made by elimination, i.e., we must eliminate the known causes until what's left should be probably be caused by some of my suspicions.

 

Edited by Lisias
Brute force post merge.
Link to comment
Share on other sites

20 minutes ago, Lisias said:

Do you remember running CKAN between the last time the game worked and the first time it started to bork?

I do have CKAN and the last time I used it it was fine

 

23 minutes ago, Lisias said:

I need some information to help me look on the thing with the proper mindset.

It's just that the menu button won't work

Every single mod that I downloaded either old or new works perfectly fine and I updated the tweakscale mod to 1.12.5 

Link to comment
Share on other sites

2 hours ago, exospaceman said:

It's just that the menu button won't work

Every single mod that I downloaded either old or new works perfectly fine and I updated the tweakscale mod to 1.12.5 

The mods don't appear to be the problem, they working together may be. The signs I see in your Player.log suggest races conditions inside KSP.

The problem with race conditions is that they are unpredictable, they are a mine field - everything looks fine until someone with bad luck steps on a mine.

So, a rig working fine can go nuts by simply adding or changing something, because it could be the last straw that will break the camel's back - or, going back to the mine field parabola, this last change could made KSP walk slightly to the right where a mine was waiting for some to step over.

pretty clear evidence of things going down the tubes on your rig (and only in your rig) is, between many, TweakScale - and I will use it as guinea pig because I know this code pretty well (unsurprisingly :P).  Please bear with me even by not understanding what follows, because my intention is to document the problem so people could reference it later.

— — WARNING: GORY TECHNICAL DETAILS FOLLOWS! NOT FOR THE FAINT OF HEART! — — 

On your Player.log I found two entries like this one:

[AddonLoader]: Instantiating addon 'TweakScaleHotKeys' from assembly 'Scale'
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Problem. It's sure that TweskScaleHotKeys is only instantiated once on a sane rig, because of this line on the code:

	[KSPAddon(KSPAddon.Startup.MainMenu, true)]
	internal class HotkeyManager : SingletonBehavior<HotkeyManager>
	{
		<yada yada yada>
        
		[UsedImplicitly]
		private new void Awake()
		{
			Log.dbg("HotkeyManager.Awake");
			base.Awake();
			DontDestroyOnLoad(this); // <---- THIS IS ALSO IMPORTANT

This behaviour is only instantiated ONCE the first time the Main Menu is loaded (see 'True' on that KSPAddon thingy) , and it's never destroyed until KSP quits (because of the DontDestroyOnLoad thingy).

Then later, I found ONE log entry for this problem:

NullReferenceException: Object reference not set to an instance of an object
  at TweakScale.Features.ScaleChaining.DeInit () [0x00012] in <d64755e43d324177804233d3acaee766>:0
  at TweakScale.TweakScaleHotKeys.OnDestroy () [0x00005] in <d64755e43d324177804233d3acaee766>:0

What's nuts, because the ScaleChaining.Deinit and the TweakScaleHotKeys.OnDestroy are correctly coded checking for things before doing anything. The only way this would happen is by the TweskScaleHotKeys being initialized TWICE in memory (what we already know it is), because after the first incarnation's OnDestroy is called, the internal data structures are destroyed and then the second one will bork for sure.

Double checking my theory, I found exactly two copies of it on memory:

> cat Player.log | grep "Instantiating addon 'TweakScaleHotKeys' from assembly 'Scale'" | wc -l
2

On my rigs, I only find one.

This means that KSP's life cycle is completely screwed up, launching things twice and destroying things out of the order, because the ScaleChaining.DeInit always happens before the TweakScaleHotKeys.OnDestroy, unless rogue copies of the TweakScaleHotKeys are lingering on memory (and probably rogue copies of the whole TweakScale too).

And, yeah, I just tried it on my rig just to be absolutely sure about it - things on my computer is happening exactly as they should.

Now, I don't really know Scatterer, so I'm unsure if it is misbehaving or not, but inspecting your Player.log I found 14 times it was being instantiated:

> cat Player.log | grep "Instantiating addon 'Scatterer' from assembly 'Scatterer'" | wc -l
14

And it appears to be too much, because as far as I know, this log entry:

[AddonLoader]: Instantiating addon 'Scatterer' from assembly 'Scatterer'
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

should happen only once.

And this should be the reason I found this:

Uploading Crash Report
NullReferenceException: Object reference not set to an instance of an object
  at Scatterer.ScreenCopyCommandBuffer.OnDestroy () [0x00029] in <43bdde13a3a142b1913e072d4d09bd61>:0

Because, in the same way TweakScale does in your rig, it should being initialising things many times, but that thing was meant to be uninitialised only once (because it was meant to be initialise only once).

— — END OF THE GORY TECHNICAL DETAILS — — 

So, unless new information is put on the table, we have determined that there's something on your rig causing the problem. But what?

Your KSP.log tells me:

OS: Windows 10  (10.0.0) 64bit
CPU: 12th Gen Intel(R) Core(TM) i7-12700F (20)
RAM: 16225
GPU: NVIDIA GeForce RTX 3070 (8043MB)
SM: 50 (Direct3D 11.0 [level 11.1])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Default, ARGB2101010, DefaultHDR, ARGB64, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8, ARGBInt, RGInt, RInt, BG

So you are using a "hybrid" CPU from Intel, with 4 Performance Cores and 8 Efficient ones. humm… I had already diagnosed that KSP (to be fair, Unity, KSP is just following suit) handles concurrency naively (stupidly is the correct word). And I had detected other things misbehaving on Intel Hybrid cores before.

So I'm almost sure this is your case.

The solution for you is to tell Windows to only run KSP on the 4 Performance Cores using a thingy called Affinity.

I think you should apply this trick to KSP:

https://www.windowsdigitals.com/how-to-set-process-cpu-affinity-priority-permanently-in-windows-10/

— — POST EDIT — — 

No!!! It's something on KSP!! I reproduced on my rig, and it's a punny MacPotato running i7 mobile!!!!

DAMN!!!!

— — POST POST EDIT — — 

DAMN²: I only reproduce the log "spam", not the NRE at the end of the log.

It looks like the log "spam" is a false alarm - it happens all the time, no matter the add'on is going to be loaded or not… 

So we have a real problem (an add'on being instantiated at least more than once when they shouldn't) those diagnosing is being made harder and harsher by a false alarm on the log. (sigh)

— — POST POST POST EDIT — — — 

Ok, I think I found what happened: on the original log, I concluded I had evidence of KSP instancing things multiple times because of the log "spam". BUT on KSP 1.4.3 I also had the log "spam", but not the NRE. And checking again my KSP 1.12.5 log, I also found the spam but not the NRE.

So the log "spam" is a bug by itself. It only happened that between the thousands of false alarms, one of them ended up hitting something real.

So we are back again to the multiple instancing of the TweakScaleHotManager . So it may be related to the asymmetric/hybrid CPU used by the user - still investigating other possibilities.

Edited by Lisias
Tyop! Surprised?
Link to comment
Share on other sites

5 hours ago, exospaceman said:

Sorry for late reply but I hope this works

Let us know in a way or another. There're a lot of people with similar problems, and not only here on Forum!!!

Cheers!

Link to comment
Share on other sites

11 hours ago, exospaceman said:

Ok that didn't work it's ok take your time to finding the problem :)

I need to find a way to put my dirty pawns on a "Hybrid" Intel machine for some weeks. There're some tests that would be more productive for me to do, instead of blindly asking users to do random tests to see what we get… :/

I will try to think on something, but I think I had run out of non-destructive tests - from now on, anything I ask you to check must be done on a full copy of the affected KSP installation. Please do not try anything more on your original one, or you will risk losing all your savegames.

I will come back to this ASAP.

Link to comment
Share on other sites

16 minutes ago, exospaceman said:

I tried using some debugging tools and even removing ckan but still no sign of improvment

CKAN doesn't cause problems directly, it is an enabler (and a hell of an enabler) but not exactly the root cause of the problem. It's like that kid on high school that learned how to grease a bike, and then tries to fix your electrical one using the same grease on the engine's gears when you ask him to just grease the wheels.

I'm trying to reproduce your problem on my rig, but without success - things work for me.

(you are doing these tests on a FULL BACKUP of your KSP, right? Please don't risk your savegames on this endeavour - things are perfectly salvageable, once we realise what's really happening).

The only left option I can think is to selectively remove add'ons from a FULL BACKUP until things start to work again - and this is not only destructive, but also cumbersome.

I suggest you start with the simplest ones. For reference, this is your full loaded assemblies list:

  •  /666_ModuleManagerWatchDog
  •  /999_Scale_Redist
  •  /ModuleManager.4.2.2
  •  000_ClickThroughBlocker/Plugins/ClickThroughBlocker
  •  000_Harmony/0Harmony
  •  000_Harmony/HarmonyInstallChecker
  •  000_TexturesUnlimited/Plugins/BlendshapeModelLoader
  •  000_TexturesUnlimited/Plugins/TexturesUnlimited
  •  000_USITools/USITools
  •  000_USITools/USIToolsUI
  •  001_ToolbarControl/Plugins/ToolbarControl
  •  999_KSP-Recall/Plugins/Attached
  •  999_KSP-Recall/Plugins/AttachedOnEditor
  •  999_KSP-Recall/Plugins/ChillingOut
  •  999_KSP-Recall/Plugins/Driftless
  •  999_KSP-Recall/Plugins/KSP-Recall
  •  999_KSP-Recall/Plugins/KSPe.Light.Recall
  •  999_KSP-Recall/Plugins/Refunding
  •  999_KSP-Recall/Plugins/Resourceful
  •  AnimationSounds/AnimationSounds
  •  AviationLights/Plugins/AviationLights
  •  AviationLights/Plugins/KSPe.Light.AviationLights
  •  B9PartSwitch/Plugins/B9PartSwitch
  •  BahaSP/Plugins/BDAnimationModules
  •  BahaSP/Plugins/RNModules
  •  Benjee10_Suits/Plugins/WearableProps
  •  Bluedog_DB/Plugins/BDB
  •  CameraTools/Plugins/CameraTools
  •  Chatterer/Plugins/Chatterer
  •  ComfortableLanding/Plugins/ComfortableLanding
  •  CommNetConstellation/Plugins/CommNetConstellation
  •  ConformalDecals/Plugins/ConformalDecals
  •  CustomPreLaunchChecks/CustomPreLaunchChecks
  •  DeployableEngines/Plugins/DeployableEngines
  •  DistantObject/Plugins/DistantObject
  •  DistantObject/Plugins/KSPe.Light.DOE
  •  DMagicScienceAnimate/DMModuleScienceAnimateGeneric
  •  EditorExtensionsRedux/Plugins/EditorExtensionsRedux
  •  EnvironmentalVisualEnhancements/Plugins/Atmosphere
  •  EnvironmentalVisualEnhancements/Plugins/CelestialShadows
  •  EnvironmentalVisualEnhancements/Plugins/CityLights
  •  EnvironmentalVisualEnhancements/Plugins/EVEManager
  •  EnvironmentalVisualEnhancements/Plugins/PartFX
  •  EnvironmentalVisualEnhancements/Plugins/PQSManager
  •  EnvironmentalVisualEnhancements/Plugins/ShaderLoader
  •  EnvironmentalVisualEnhancements/Plugins/Terrain
  •  EnvironmentalVisualEnhancements/Plugins/TextureConfig
  •  EnvironmentalVisualEnhancements/Plugins/Utils
  •  EnvironmentalVisualEnhancements/Plugins/_BuildManager
  •  EvaFollower/Plugins/EvaFollower
  •  FMRS/Plugins/FMRSContinued
  •  FreeIva/Plugins/FreeIva
  •  FShangarExtender/Plugins/HangerExtenderExtended
  •  HullCameraVDS/Plugins/HullcamVDSContinued
  •  JSI/RasterPropMonitor/Plugins/RasterPropMonitor
  •  KerbalKonstructs/KerbalKonstructs
  •  KerBalloons/Plugins/KerBalloons
  •  Kerbaltek/HyperEdit
  •  Kopernicus/Plugins/Kopernicus
  •  Kopernicus/Plugins/Kopernicus.Parser
  •  KSRSS/Patches/LoadingScreens/Sigma88LoadingScreens
  •  ModularFlightIntegrator/ModularFlightIntegrator
  •  ModuleManagerWatchDog/Plugins/WatchDogForInterstellarRedist
  •  ModuleManagerWatchDog/Plugins/WatchDogForScaleRedist
  •  ModuleManagerWatchDog/Plugins/WatchDogInstallChecker
  •  Parallax/Grass
  •  Parallax/ParallaxOptimized
  •  Parallax/ParallaxQualityLibrary
  •  PlanetShine/Plugins/PlanetShine
  •  ReentryParticleEffectRenewed/Plugin/ReentryParticleEffectRenewed
  •  Scatterer/Scatterer
  •  Shabby/Plugins/Shabby
  •  SimpleAdjustableFairings/Plugins/SimpleAdjustableFairings
  •  SmokeScreen/SmokeScreen
  •  SpaceTuxLibrary/Plugins/ButtonManager
  •  SpaceTuxLibrary/Plugins/KSP_ColorPicker
  •  SpaceTuxLibrary/Plugins/KSP_Log
  •  SpaceTuxLibrary/Plugins/KSP_PartHighlighter
  •  SpaceTuxLibrary/Plugins/SpaceTuxUtility
  •  SpaceTuxLibrary/Plugins/VesselModuleSave
  •  Squad/Plugins/KSPSteamCtrlr
  •  StagedAnimation/Plugins/StagedAnimation
  •  SystemHeat/Plugin/SystemHeat
  •  TacSelfDestruct/Plugins/TacSelfDestruct
  •  TextureReplacer/Plugins/TextureReplacer
  •  ThroughTheEyes/Plugins/ThroughTheEyes
  •  TUFX/Plugins/TUFX
  •  TweakScale/Plugins/KSPe.Light.TweakScale
  •  TweakScale/Plugins/Scale
  •  VaporVent/Plugins/VaporVent
  •  VesselMover/Plugins/VesselMover
  •  Waterfall/Plugins/Waterfall

Again, on a FULL COPY (because any savegame you have will be royally screwed if you load it on the process), please start by removing everything from me, so we can rule me out of the problem:

  • 999_KSP-Recall
  • AviationLights
  • DistantObject
  • ModuleManagerWatchDog (and the 666_ModuleManagerWatchDog thingy on GameData)
  • TweakScale (and the 999_Scale_Redist thingy on GameData)

I don't think this will change anything, but I want to be absolutely sure - mainly because the next logical step is to remove these ones:

  • 000_Harmony
  • Kopernicus

I don't think that any of these ones are the culprit (my owns in special are  double check down to KSP 1.4.3, and a few ones down to 1.3.1!! I would had detected something really fishy when testing them on 1.12.5), but if by lack of luck any of these makes the problem go away, dependending which one I will know where to look more closely. Right now, there're just too many places to look at.

If by removing the above add'ons, you still have a problem, post a new KSP.log and Player.log after reproducing it (and quitting KSP to prevent the logs from being truncated!), and we will start again.

If by removing that ones the problem goes away, please add them back one by one until the problem is back, and them tell me which one triggered the problem (also, with the KSP.log and Player.log - same drill).

Good hunting! (and good luck!)

Link to comment
Share on other sites

23 minutes ago, Lisias said:

(you are doing these tests on a FULL BACKUP of your KSP, right? Please don't risk your savegames on this endeavour - things are perfectly salvageable, once we realise what's really happening).

Oh yes defiantly, my saved sandbox is important for me as I have all of the spacecraft I need for my space series so I am using a test copy instead

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...