Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.20.2 Linux Client Crashes with Kethane 0.4.4 through 0.5.1 #78

Closed
jasongraham opened this issue Jun 9, 2013 · 17 comments
Closed

0.20.2 Linux Client Crashes with Kethane 0.4.4 through 0.5.1 #78

jasongraham opened this issue Jun 9, 2013 · 17 comments

Comments

@jasongraham
Copy link

I'm getting a crash whenever I have the Kethane mod installed. This crash does not occur when Kethane is not included.

Let me know if I can provide additional information or you would like me to try something different.

Test Environment

Linux, KSP 0.20.2, newly added Kethane 0.4.4, no other mods.

Note that crashes will still occur even if Kethane has not been newly installed, but with a newly installed Kethane the crash is consistent as to when it occurs.

Steps to Reproduce

  1. Open KSP, Start new game.
  2. Load VAB, create a simple craft with just a pod and the kethane.highgain detector part. Save Craft.
  3. Launch Craft. Turn the detector on, open up the detection map. Optionally close map and turn detector off.
  4. End Flight -> Game Crashes.

Linked here is a gist containing the KSP.log and the Unity Player.log starting at the VAB until crash.

I've had some difficulty creating a consistent test case (sometimes the crash will happen sooner in the process on subsequent runs with Kethane already installed, like at the start of switching to flight mode), but for a newly added Kethane install, it always crashes as above.

@jasongraham
Copy link
Author

I've played around with this a little more, and the parts that are causing the crash seem to be both detectors and the drill. Ships mounted with the converter don't cause a crash, but I'm not able to test actually converting Kethane.

EDIT: I edited one of the tank parts to start with some Kethane to test that converting doesn't cause a crash. Conversion seems to work fine.

@Majiir
Copy link
Owner

Majiir commented Jun 9, 2013

Thanks for the quality report!

I have a hunch why this is happening, and I think the deposit saving changes coming in the next version will resolve the issue. That update is coming very soon, so let's try again then.

In the meantime, do the Kethane PluginData folder and its contents have write permissions set correctly? I think the crash happens when Kethane tries to save its data.

@jasongraham
Copy link
Author

My user (grahjm2a) has write permission to everything under $KSPDIR/GameData/Kethane, and some form of data is being saved under the PluginData directory. Is there anything missing that you would expect to be there?

$ pwd
/opt/KSP_linux/GameData/Kethane

$ ls -al
total 20K
drwx------  5 grahjm2a users 4.0K Jun  9 10:05 .
drwxr-xr-x  4 grahjm2a users 4.0K Jun  9 10:05 ..
drwx------ 14 grahjm2a users 4.0K Jun  9 10:05 Parts
drwx------  3 grahjm2a users 4.0K Jun  9 10:05 Plugins
drwx------  2 grahjm2a users 4.0K Jun  9 10:05 Resources

$ ls -al Plugins/
total 48K
drwx------ 3 grahjm2a users 4.0K Jun  9 10:05 .
drwx------ 5 grahjm2a users 4.0K Jun  9 10:05 ..
-rw-r--r-- 1 grahjm2a users  34K Jun  9 10:05 MMI_Kethane.dll
drwx------ 3 grahjm2a users 4.0K Jun  9 10:05 PluginData

$ ls -al Plugins/PluginData/
total 12K
drwx------ 3 grahjm2a users 4.0K Jun  9 10:05 .
drwx------ 3 grahjm2a users 4.0K Jun  9 10:05 ..
drwx------ 3 grahjm2a users 4.0K Jun  9 10:08 MMI_Kethane

$ ls -al Plugins/PluginData/MMI_Kethane/
total 404K
drwx------ 3 grahjm2a users 4.0K Jun  9 10:08 .
drwx------ 3 grahjm2a users 4.0K Jun  9 10:05 ..
-rw-r--r-- 1 grahjm2a users  658 Jun  9 10:38 Bop.png
-rw-r--r-- 1 grahjm2a users 319K Jun  9 13:38 Deposits.dat
-rw-r--r-- 1 grahjm2a users  658 Jun  9 10:38 Dres.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Duna.png
-rw-r--r-- 1 grahjm2a users  658 Jun  9 10:38 Eeloo.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Eve.png
-rw-r--r-- 1 grahjm2a users  658 Jun  9 10:38 Gilly.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Ike.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Jool.png
-rw-r--r-- 1 grahjm2a users 1.1K Jun  9 10:38 Kerbin.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Laythe.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Minmus.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Moho.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Mun.png
-rw-r--r-- 1 grahjm2a users  658 Jun  9 10:38 Pol.png
-rw-r--r-- 1 grahjm2a users  881 Jun  9 10:38 Sun.png
-rw-r--r-- 1 grahjm2a users 1.3K Jun  9 10:38 Tylo.png
-rw-r--r-- 1 grahjm2a users 1.2K Jun  9 10:38 Vall.png
-rw-r--r-- 1 grahjm2a users  136 Jun  9 10:05 YouAreHereMarker.png
drwx------ 2 grahjm2a users 4.0K Jun  9 10:05 sounds

$ ls -al Plugins/PluginData/MMI_Kethane/sounds/
total 156K
drwx------ 2 grahjm2a users 4.0K Jun  9 10:05 .
drwx------ 3 grahjm2a users 4.0K Jun  9 10:08 ..
-rw-r--r-- 1 grahjm2a users 133K Jun  9 10:05 echo_deposit.wav
-rw-r--r-- 1 grahjm2a users 9.0K Jun  9 10:05 echo_empty.wav

@Majiir
Copy link
Owner

Majiir commented Jun 9, 2013

Everything looks right there, and the logs aren't very helpful, so I'm not sure how to help you except to get the next update pushed out. If that doesn't resolve the issue, I'll boot up a Linux VM and see if I can't reproduce it.

@jasongraham
Copy link
Author

I look forward to the next update. Thanks for taking a look.

@Majiir
Copy link
Owner

Majiir commented Jun 11, 2013

I've just released 0.5. Give it a try and let me know what happens.

@jasongraham
Copy link
Author

I won't have time to test for a couple days, but I will test by this coming weekend at the latest.

Thanks for the heads up that 0.5 is released.

@jasongraham
Copy link
Author

I lied, I couldn't wait.

There seems to be an improvement. Now if I don't have both a detector and a drill, I can launch and end flight successfully. This is a weird error.

Using the same procedure as above, the first crash happened when when switching to flight mode out of the VAB, before I even got into flight. I wasn't able to replicate this, so let's assume that it was a fluke.

I duplicated my above procedure and then ended flight and returned to the VAB. I then added a drill and storage tank, relaunched, and at that point the game crashed. I tried this a couple times, with the same results.

For another test, I built a pod with a tank and a drill (no detector) and was able to launch and end flight successfully. Adding a detector again caused a crash.

As a final test, I built my pod/detector part test vehicle, and repeatedly launched it over and over again, without crashes. After a few times, I added a Kethane tank and a drill, launched, and the game then crashed.

The end of my logs for the last crash are below. Again, I don't see any useful stack trace or similar, but at least there is some Kethane specific logging info this time. If there is a specific pattern you would like to try, let me know.

KSP.log

[LOG 22:12:29.316] ------------------- initializing editor mode... ------------------
[LOG 22:12:29.316] editor started
[LOG 22:12:29.316] Loading ship
[LOG 22:12:29.317] loading part: mk1pod
[LOG 22:12:29.317] loading part: kethane.highGain
[LOG 22:12:29.317] loading part: mk1pod
[LOG 22:12:29.327] loading part: kethane.highGain
[LOG 22:12:29.347] Untitled Space Craft loaded!
[LOG 22:12:29.348] Untitled Space Craft - Untitled Space Craft
[LOG 22:12:33.911] [MMI.K Miner 01(Clone)]: Activated (forced)
[LOG 22:12:39.229] MMI.K Miner 01(Clone) added to ship - part count: 3
[LOG 22:12:39.230] stage count is: 0
[WRN 22:12:39.234] Kethane deposits saved (3ms)
[LOG 22:12:45.316] MMI.K FuelTank - External(Clone) added to ship - part count: 4
[LOG 22:12:45.329] stage count is: 0
[WRN 22:12:45.333] Kethane deposits saved (3ms)
[WRN 22:12:47.382] Kethane deposits saved (3ms)
[LOG 22:12:47.397] Launching vessel from LaunchPad. Craft file: /extra/games/KSP_linux_0.20_test/KSP_Data/../saves/default/Ships/VAB/Auto-Saved Ship.craft
[WRN 22:12:49.489] Cannot find preset 'Default' for pqs 'Eeloo'
[WRN 22:12:49.520] Cannot find preset 'Default' for pqs 'Pol'
[WRN 22:12:49.538] Cannot find preset 'Default' for pqs 'Dres'
[LOG 22:12:49.731] ------------------- initializing flight mode... ------------------
[LOG 22:12:49.732] [CREW ROSTER]: Resuming from SFS
[LOG 22:12:49.732] Loading ship from file: /extra/games/KSP_linux_0.20_test/KSP_Data/../saves/default/Ships/VAB/Auto-Saved Ship.craft
[LOG 22:12:49.733] Loading ship
[LOG 22:12:49.733] loading part: mk1pod
[LOG 22:12:49.733] loading part: kethane.highGain
[LOG 22:12:49.733] loading part: MMI.K Miner 01
[LOG 22:12:49.733] loading part: MMI.K FuelTank - External
[LOG 22:12:49.733] loading part: mk1pod
[LOG 22:12:49.743] loading part: kethane.highGain
[LOG 22:12:49.748] loading part: MMI.K Miner 01
[LOG 22:12:49.754] loading part: MMI.K FuelTank - External
[LOG 22:12:49.824] Untitled Space Craft loaded!
[WRN 22:12:49.920] Kethane deposits loaded (95ms)

Unity Player.log


(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Loading ship

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: mk1pod

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: kethane.highGain

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: mk1pod

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: kethane.highGain

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Untitled Space Craft loaded!

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Untitled Space Craft - Untitled Space Craft

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

[MMI.K Miner 01(Clone)]: Activated (forced)

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

MMI.K Miner 01(Clone) added to ship - part count: 3

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

stage count is: 0

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Kethane deposits saved (3ms)

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

MMI.K FuelTank - External(Clone) added to ship - part count: 4

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

stage count is: 0

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Kethane deposits saved (3ms)

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Kethane deposits saved (3ms)

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Launching vessel from LaunchPad. Craft file: /extra/games/KSP_linux_0.20_test/KSP_Data/../saves/default/Ships/VAB/Auto-Saved Ship.craft

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 440 unused Assets to reduce memory usage. Loaded Objects now: 50588.
Total: 69.517998 ms (FindLiveObjects: 7.651000 ms CreateObjectMapping: 2.727000 ms MarkObjects: 41.723003 ms  DeleteObjects: 17.250999 ms)

Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 50586.
Total: 52.507999 ms (FindLiveObjects: 7.767000 ms CreateObjectMapping: 2.604000 ms MarkObjects: 41.832001 ms  DeleteObjects: 0.251000 ms)

Shader 'AtmosphereFromGround': fallback shader 'None' not found
Cannot find preset 'Default' for pqs 'Eeloo'

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Cannot find preset 'Default' for pqs 'Pol'

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Cannot find preset 'Default' for pqs 'Dres'

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Unloading 5 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 127 unused Assets to reduce memory usage. Loaded Objects now: 54454.
Total: 56.694000 ms (FindLiveObjects: 7.785000 ms CreateObjectMapping: 2.688000 ms MarkObjects: 44.255001 ms  DeleteObjects: 1.809000 ms)

------------------- initializing flight mode... ------------------

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

[CREW ROSTER]: Resuming from SFS

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Loading ship from file: /extra/games/KSP_linux_0.20_test/KSP_Data/../saves/default/Ships/VAB/Auto-Saved Ship.craft

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Loading ship

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: mk1pod

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: kethane.highGain

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: MMI.K Miner 01

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: MMI.K FuelTank - External

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: mk1pod

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: kethane.highGain

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: MMI.K Miner 01

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

loading part: MMI.K FuelTank - External

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Untitled Space Craft loaded!

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

Kethane deposits loaded (95ms)

(Filename: /BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/LinuxStandalonePlayer/UnityEngineDebug.cpp Line: 54)

@Majiir
Copy link
Owner

Majiir commented Jun 11, 2013

Fascinating. Can you try with two detectors? Two drills?

The change in behavior makes some sense. Prior to 0.5, detectors and extractors would both call SaveAndLoadState in their OnSave routine. Now, detectors only call SaveAllMaps, and extractors only call SaveKethaneDeposits. So, previously, a single part was enough to cause a crash because two I/O operations were happening in the same call, whereas now, it takes two parts to cause two I/O requests. Maybe.

The part that doesn't make sense is that it does it on launch, which AFAIK does not call OnSave, and that the detector would do anything at all, since it saves a different set of files. So, I guess that's probably not it. Still, it's notable that only the detector and extractor cause the issue, since they actually work with saved data.

Can you try loading a ship with the debugger part and open its map view? Its possible that anything instantiating a KethaneController causes the crash.

@jasongraham
Copy link
Author

At work at the moment, but wanted to verify: does the 0.4.4 debug part still work with 0.5?

Your forum post still points to 0.4.4 debugger.

@Majiir
Copy link
Owner

Majiir commented Jun 11, 2013

That post indicates the debugger works for version 0.4.4-0.5. The debugger doesn't require updates as often as the main build.

@prometheanfire
Copy link

can you try doing this to your ksp binary, I've found that it helps with crashes (this is if you are running on amd64)

$ xxd -s +0x7cebc7 -l 1 KSP.x86_64
07cebc7: 01
$ echo "7cebc7: 00" | xxd -r - KSP.x86_64
$ xxd -s +0x7cebc7 -l 1 KSP.x86_64
07cebc7: 00

$ xxd -s +0x7cebcc -l 1 KSP.x86_64
07cebcc: 01
$ echo "7cebcc: 00" | xxd -r - KSP.x86_64
$ xxd -s +0x7cebcc -l 1 KSP.x86_64
07cebcc: 00

@jasongraham
Copy link
Author

@prometheanfire, I'm reluctant to modify my binary without understanding better what that does exactly. I understand we're flipping a bit, but I would like to know what the effect of that is.

If there is indeed a bug with the binary, that should be reported to Squad. I haven't experienced a significant number of crashes without Kethane.

@jasongraham
Copy link
Author

@Majiir, I updated to the 0.5.1 Kethane release before continuing testing.

Today, I had several instances where I was getting crashes, but they aren't as consistent as they used to be.

One area of frequency crashing (about 3/4 of game starts) happens as follows:

  1. Start KSP.
  2. New game (overwrite old settings and get new seed)
  3. Create in VAB 2 part pod / detector craft.
  4. Launch -> crash.

Another smaller percentage of game starts crash on the following launch. I didn't get this to happen enough to figure out if adding more parts triggered this or not.

But once when starting a new game (out of about a dozen times), I could repeatedly launch crafts with all sorts of configurations, including the debugger, multiple detectors, multiple drills, drills and detectors, ...

I also tried starting the game with a pod / debugger combination a few times (and then relaunching with the identical ship). I didn't have a crash, but as soon as I tried to launch again with a detector there was a crash.

I'm really stumped as to what might be wrong. For comparison, I tried again multiple times restarting the game and launching and relaunching without any Kethane components, but never had a crash.

Perhaps if you were to make a special log spamming build that I could test with, it would give us more insight into where exactly the crash is occurring. I don't mind doing multiple runs with different configurations to narrow this down. I really want to be able to use this plugin.

@prometheanfire
Copy link

It modifies the code in loading textures (I think). It came from here.

http://forum.kerbalspaceprogram.com/showthread.php/33232-Linux-version-does-not-start-unless-some-files-are-removed

@jasongraham
Copy link
Author

@prometheanfire Interesting. I'm not having the exact same problems as these folks with not being able to load the game, but when I do patch the binary, it does seem to solve the problem. Thanks for pointing to that forum thread.

@Majiir, I suggest that you browse the thread, but it looks like the problem is occurring in Squad's code. I just doesn't manifest in my case unless Kethane is loaded to increase the amount of memory allocated beyond a 32 bit address space.

I'm going to close this as it seems my issue has been resolved.

@jasongraham
Copy link
Author

Alternative explanation: since the problem referenced in the thread seems to be deal with PNG loading code, and the maps are saved as PNGs, the problem may have arisen when those PNG needed to be read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants