Jump to content

I believe I solved my constant crashing of Kerbal Space Program myself and thought I would share....


Recommended Posts

  • 3 weeks later...

Field report:

Well here I am running 1.6.1 64bit with the typical hundred plus mods.  Of note are GPP&GEP,  MKS/OKS, KSP InterstellarE, and AFBW.  AFBW is all about the x_input as it is a joystick mod.  I also had the periodic crash of System32/xinput1_3.dll, plus the steamapi.dll along side it.

Now the operating theory if I get this right is the 64bit dll is not to be used and counterintuitively we need to make it use the 32bit version.  Correct?

I tried the original solution of copying System32/xinput1_3.dll to KSP_x64_Data/Plugins.  But that doesn't make sense as it's the 64bit version and the "good" 32 bit version is already in Plugins.  Despite that, I did that and still got the periodic crash showing System32/xinput1_3.dll.  So I moved the windows version aside and put the KSP 32bit one in place of it.   The crash related to that stopped.  

However AFBW also has SDL2.dll in the main KSP directory and it's 64bit.  After a longer period of stable play I eventually crashed and the crash log only showed it for the access violation.  So some progress.  I have downloaded the latest SDL2.dlls and have the 32bit one in the main KSP directory.  I will move the 32bit x_input there as well and restore System32 to its original state.  I will report what happens...

Link to comment
Share on other sites

17 hours ago, kurtu5 said:

However AFBW also has SDL2.dll in the main KSP directory and it's 64bit.  After a longer period of stable play I eventually crashed and the crash log only showed it for the access violation.  So some progress.  I have downloaded the latest SDL2.dlls and have the 32bit one in the main KSP directory.  I will move the 32bit x_input there as well and restore System32 to its original state.  I will report what happens...

Ok so it simply did not like me using another SDL2.dll than linuxgamer provided in his AFBW ckan distro.  So I restored that.  The 'trick' of putting the 32 bit x_input in the KSP main directory did not make it use it and it still was crashing with the System32 64bit version.  

Supposedly the KSP_x64.exe ninary should search the current diectory first before going down the PATH, but I suppose xinput1_3.dll is a special "Known DLL" that is actually the first matching rule according to the below documentation.  I guess messing with System32 is the only easy way for now.

Search Path Used by Windows to Locate a DLL

Link to comment
Share on other sites

On 5/3/2019 at 10:04 AM, kurtu5 said:

Now the operating theory if I get this right is the 64bit dll is not to be used and counterintuitively we need to make it use the 32bit version.  Correct?

As weird as it appears, appears to be correct. At least up to 1.6.1. 

Things appears to be changing as per Version basis. My previous findings suggests the problem is not exactly KSP, but something related to the Mono's JIT, or at least to the Unity's Mono.

 

On 5/3/2019 at 10:04 AM, kurtu5 said:

I tried the original solution of copying System32/xinput1_3.dll to KSP_x64_Data/Plugins.  But that doesn't make sense as it's the 64bit version and the "good" 32 bit version is already in Plugins.  Despite that, I did that and still got the periodic crash showing System32/xinput1_3.dll.  So I moved the windows version aside and put the KSP 32bit one in place of it.   The crash related to that stopped.  

Windows doesn't makes sense. :) 

What happens is that Windows uses a kind of "bridge" to allow 64 bits code to call 32 bits code, It's a hack, but apparently they had to do it as they can't just recompile the World to 64 bits as Open Source guys can do.

The very weird thing is that, by some unreachable reason, the Unity's code that calls the X_INPUT (and not only the 1.3, the thingy falls back to 2 or 3 different versions of the DLL - it's a plain hell) appears to be attached to a C# code that translates to 32 bits far-calls when calling native code. Yeah, yet another bridge - from de C# Land to Windows Native Land (were there're bridges on the 64 bits land and the 32 bits land).

Things works fine while your memory footprint allows the JIT (a thing inside Mono's that compiles in runtime CIL - the Mono's bytecode - into x86 machine language) to place binary code in a place where it can reach the X_INPUT code in a 32 bits far call. Stock KSP usually allows that, but once we shove Add'Ons into KSP, the memory footprint pushes the free memory away from the X_INPUT code in memory, and sooner or later the JIT compiles something into a memory beyound the reach of a 32 bits far-call - and this is when our crashes happens.

My current guess (I have about two a year! =P ) is that somehow, by using a 32 bits X_INPUT dll, the JIT tries harder to use memory that is not beyound that 32 bits far-call reach.

However, things has changed on 1.7 - this postulate of mine appears to do not cope very well. Until I grasp a Windows machine again, I'm on the dark and depending of third parties reports.

What makes me remember: could you send me the material you have?

Link to comment
Share on other sites

1 hour ago, Lisias said:

What makes me remember: could you send me the material you have?

You mean like KSP.log and error.log?  And from which state conditions?  Crashes with xinput kludged into System32 or without?

I think this error.log is when I had the 32bit version in System32 and steamapi.dll.disabled as per my initial field report; https://pastebin.com/CsNxyL9q

I think you were particularly interested in mem locations, so here is a grep of error.log in various configurations; https://pastebin.com/AirLvD4E

Link to comment
Share on other sites

  • 4 months later...

This just got to my attention.

MSI Afterburner, RIVA Tuner and perhaps others adding layers to the Unity application can lead to a crash similar to the ones on this thread.

Steam also adds a layer. It may be another trigger to the problem.

 

Link to comment
Share on other sites

  • 1 year later...
On 1/16/2021 at 7:29 PM, JAFO said:

Why? Are you experiencing regular crashing?

He and a huge amount of people! 

 

On 1/16/2021 at 6:04 PM, adriangm44 said:

Is this still working? 

How are you fixing it now since there's no such dll's in KSP_x64_Data/Plugins anymore?

That source of crashes was happening on Windows and KSP <= 1.7.3 .

On KSP 1.8.0, Squad updated Unity to 2019, and this solved some problems that were plaguing KSP, the one that sparked this thread being one of them.

However, there's a major bork on the Unity minor version currently in use by KSP that it's also leading to crashes - so, in essence, vendors are stilk screwing up Squad.

Check the thread below to see if you issue fits. The most informative posts are on the last pages, when we apparently nailed the problem. But, until this moment, a work around wasn't found yet...

Anyway, if this fits your issue, please follow suit on posting your logs and commenting something on the issue track. The more people affected complains, bigger the chances we have to get this fixed.

Link to comment
Share on other sites

4 hours ago, Lisias said:

He and a huge amount of people! 

 

That source of crashes was happening on Windows and KSP <= 1.7.3 .

On KSP 1.8.0, Squad updated Unity to 2019, and this solved some problems that were plaguing KSP, the one that sparked this thread being one of them.

However, there's a major bork on the Unity minor version currently in use by KSP that it's also leading to crashes - so, in essence, vendors are stilk screwing up Squad.

Check the thread below to see if you issue fits. The most informative posts are on the last pages, when we apparently nailed the problem. But, until this moment, a work around wasn't found yet...

Anyway, if this fits your issue, please follow suit on posting your logs and commenting something on the issue track. The more people affected complains, bigger the chances we have to get this fixed.

You're a real help here, thanks. I don't know if it'll fit my problem, in fact, I don't know what's causing the crash at all... All I could do is sharing my log files but beyond that... This post was exactly where I felt my game's crash was more alike (Loading screen multiple times between traking station, VAB, active vessels... and then one more loading and crash).

I will take a look though, thanks for the help budd.

Link to comment
Share on other sites

28 minutes ago, adriangm44 said:

You're a real help here, thanks. I don't know if it'll fit my problem, in fact, I don't know what's causing the crash at all... All I could do is sharing my log files but beyond that...

Well, since we are here, post the log and let us give a look on it. :)

Link to comment
Share on other sites

28 minutes ago, adriangm44 said:

I haven't been playing ksp over the last week sorry. Do I have to send the log after the game crashed or just the log anytime will do?

Whe  the game crashed. The Player.log is important too, as KSP.log don't have all the information we need.

Link to comment
Share on other sites

  • 5 weeks later...

The OP's solution worked absolute wonders for me.  My install sounds similar to his with many mods.  My main crash was when entering the vah or sph, maybe other buildings as well, but i didnt notice.

  After copying this file into the place he instructed, my crashing went from always in under an hour, usually much quicker, to i have only crashed once, and it was due to me coming in a little hot at  20 m/sec + vertical drop ( i didnt catch the exact number) with a plane and i bounced off the runway instead of blowing up.  This instantly caused some physics error.

Ive enjoyed 4+ hours at a time without a crash, i cant remember the last time that happened.  Been a long time since i played an install without a 100+ mods and you sort of have to expect some issues.   

 

Thank you OP

Link to comment
Share on other sites

1 hour ago, Woj said:

The OP's solution worked absolute wonders for me.  My install sounds similar to his with many mods.  My main crash was when entering the vah or sph, maybe other buildings as well, but i didnt notice.

  After copying this file into the place he instructed, my crashing went from always in under an hour, usually much quicker, to i have only crashed once, and it was due to me coming in a little hot at  20 m/sec + vertical drop ( i didnt catch the exact number) with a plane and i bounced off the runway instead of blowing up.  This instantly caused some physics error.

Ive enjoyed 4+ hours at a time without a crash, i cant remember the last time that happened.  Been a long time since i played an install without a 100+ mods and you sort of have to expect some issues.   

 

Thank you OP

Also, keep an eye on these posts

Link to comment
Share on other sites

  • 10 months later...
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...