Jump to content

KSP locks up when loading massive space station


Recommended Posts

Hi folks,

Just spent a week building a massive space station, with parts from countless mods. I'm not sure which mod is to blame and was hoping someone could just read my logs and hopefully figure out what mod is throwing up the errors, so I can then talk to relevant mod dev...

Anyway, I had just built my space station. It was pretty big, but there wasn't any lag when opening it before. So anyway, I set up a long-term experiment (from the Station Science mod), and went back to the tracking station to time-warp ahead until the experiment was done (a few Kerbal days). Then I clicked switched back to the station via the TS and then KSP locked up.

Closed KSP, restarted, and now every time I try to switch to the station, either via the TS or via another spacecraft, KSP hangs. (I can load other spacecraft that are already in orbit just fine)

Running KSP v0.24.2 on Mac OS X 10.9.

Player log: here.

List of mods in use:

(these are based on the folder names in \GameData\, so not sure if they're the mod's official names or not...)

(these are all up to date)

Toolbar

Active Texture Management (aggressive mode)

Aligned Currency Indicator

AutoSave

BahaSP

CactEye telescope

Coherent Contracts

DebRefund

Action Groups Extended

Docking Port Alignment Indicator

Kerbal Engineer Redux

Enhanced Nav Ball

FAR

Final Frontier

Fine Print

Firespitter

FloorIt

Haystack Continued

Kerbal Attachment System

Kerbal GPS

Kethane

Klockheed Martian

Klockheed Martian special pack

KSP AVC

Infernal Robotics

MechJeb

(Module Manager v2.2.1)

6S Service Compartments

Procedural Fairings

RCS Build Aid

RCS Sounds

RealChute

Research Them All

Scene Jumper

Science Alert

Spaceplane Plus

SPD/Hex Truss

Station Science

TAC Fuel Balancer

TAC Part Lister

Kerbal Alarm Clock

Tweak Scale.

Thanks in advance for any advice given. :)

Dave

Link to comment
Share on other sites

Are you sure that's the whole log? Also, can you zip the file and upload it? It looks like it got converted to richtext or something.

(It cuts off while KSP appears to still be going strong)

As it stands you've got plenty of exceptions, but it's unclear which is the one that happens right before the problem.

Please launch KSP, *just* replicate the problem, then *immediately* quite KSP, then zip and upload the player.log.

Thanks!

Link to comment
Share on other sites

Thanks for being willing to help me out, NathanKell; I appreciate it.

OK, so this time I opened KSP, went straight to TS, then switched to the station (called 'Particle Accelerator Orbiter'... I'll let you guess what bosons it's chasing down. ;) ).

Every other time, when I say "lock up", KSP has half-loaded the UI; I can see the MechJeb windows, the KSP loading bar and the Toolbar mod but nothing else (i.e. a black screen otherwise). Then it gets the Mac OS X "rainbow spinning ball of doom" and OS X's activity monitor says that KSP is not responding, and that's when I force-quited KSP.

This time, though, I let it run and did nothing.

The screen changed a few times. Three time-stamped screenshots in this zip file. (note the second screenshot has OS X's notification centre pop-up in the top-right corner... dunno how familiar you are with OS X but that shouldn't cause any issues)

Then, suddenly, KSP just closed. No warnings, no errors, nothing. Just <blink> and I was back in OS X and KSP was gone. It took about five minutes between when I clicked 'switch to' in the tracking station and when KSP closed.

Anyway, I also noticed OS X's Console only shows the most recent 16mb of a log, hence why the last one was cut-off mid-way. I have uploaded archive.zip here, which has Player0.log and Player1.log - 0 is the first half of the entire log, and 1 is the second half.

Note that the entire log file was 29mb, so there is overlap in the two files.

i.e.

Player0 = 0 to 16mb of the 29mb log.

Player1 = 13 to 29mb of the 29mb log.

Le sigh, OS X, Y U DO DIS TO LOGS?

Anyway, thanks in advance for any thoughts you may have.

Link to comment
Share on other sites

Sure!

Alas there's not standard "read here for details" about logs; there's generally three things one can glean from a log.

1. If you're the author of the mod in question, you can get info on why/how your mod is breaking (but you have to know your mod's code well, i.e. *be* the author)

2. You can search for Exception and see what is throwing/catching exceptions. You'll get the fully qualified name of the method that threw the exception, and the stack trace back up until it was caught by Unity. This will tell you what mods have issues.

3. (Relevant in your case) You can check at the bottom of the log and work upward and see what the most recent exception(s) were. In your case, it says "out of memory" so....I think you ran out of memory. :)

On Mac KSP is 32bit only, so you get a maximum of ~3.3GB allocated to it. If you go over that limit, Unity will crash. Sounds like you need to either remove some (part-heavy) mods, and/or increase the scale= paramters in ATM (scale is actually a divisor, basic defaults to 1, aggressive to 2)

Regarding the log: huh! Thanks for the extra effort! Are you sure just zipping and uploading that file, rather than trying to read it, still results in only half the file getting zipped?

Link to comment
Share on other sites

Sure!

Alas there's not standard "read here for details" about logs; there's generally three things one can glean from a log.

1. If you're the author of the mod in question, you can get info on why/how your mod is breaking (but you have to know your mod's code well, i.e. *be* the author)

2. You can search for Exception and see what is throwing/catching exceptions. You'll get the fully qualified name of the method that threw the exception, and the stack trace back up until it was caught by Unity. This will tell you what mods have issues.

Ok, thanks for those tips. Hopefully I'll be able to figure out what mod is causing what error soon and I won't have to bug you in the general support area. ;)

3. (Relevant in your case) You can check at the bottom of the log and work upward and see what the most recent exception(s) were. In your case, it says "out of memory" so....I think you ran out of memory. :)

On Mac KSP is 32bit only, so you get a maximum of ~3.3GB allocated to it. If you go over that limit, Unity will crash.

D'oh! I looked everywhere for that error but missed it. -.-

I was of the understanding KSP for OS X was 64-bit? Obviously I wrong... :/

How stable is 64-bit KSP under Linux? (I have heard the Winblows 64-bit version is unstable so probably won't try that...)

It's interesting that the craft was fine and there was NO lag whatsoever before I started the experiments. Is that what could have tipped it over the 3.3gb max?

Sounds like you need to either remove some (part-heavy) mods, and/or increase the scale= paramters in ATM (scale is actually a divisor, basic defaults to 1, aggressive to 2)

All this time I thought I was using the aggressive mode. Seems I wasn't. Facepalm. Retried with all scale = parameters changed to 2. Still crashed, same symptoms, although this time it seems to have gotten further (note in this screenshot the readings in MechJeb aren't zero or N/A, although the readings are all wrong, e.g. look at the altitude. :P )

Can I change the scale parameters to a higher number for MOAR memory savings? Or is it just the 1 or 2 option?

Bit frustrating, but I understand there's little that can be done. She had just reached maturation. Was going to add on some nuclear engines onto those radial trusses and take her for a spin 'round the cosmos.

(I'm wondering if I can just copy-pasta the save and GameData folders into a 64-bit Linux install...)

Regarding the log: huh! Thanks for the extra effort! Are you sure just zipping and uploading that file, rather than trying to read it, still results in only half the file getting zipped?

The only way to save it is t open Console, find the log and go File > Save As, right? Or is the log itself hidden in a folder somewhere that I can get to via Finder?

By the way, what on Earth is a null exception? I see them constantly in the logs...

I'm also getting "malloc" errors, which I assume are memory allocation errors... here's the tail end of the latest log:

(Filename: Line: 275)

An error occured that wasn't supposed to. Contact support.

(Filename: Line: 281)

An invalid object handle was used.

(Filename: Line: 308)

An invalid object handle was used.

(Filename: Line: 309)

An invalid parameter was passed to this function.

(Filename: Line: 311)

KSP(1820,0xb041f000) malloc: *** mach_vm_map(size=8388608) failed (error code=3)

*** error: can't allocate region

*** set a breakpoint in malloc_error_break to debug

Receiving unhandled NULL exception

Obtained 14 stack frames.

Does that mean anything in particular? I note Activity Monitor shows KSP is only using 2.96GB of memory...

Edited by DavidHunter
Answered NathanKell's question that I quoted but forgot about.
Link to comment
Share on other sites

The only way to save it is t open Console, find the log and go File > Save As, right? Or is the log itself hidden in a folder somewhere that I can get to via Finder?

It's in a hidden folder. From Finder: Go > Go to Folder... and type ~/Library/. Then go to Logs/Unity/ and you'll see Player.log.

By the way, what on Earth is a null exception? I see them constantly in the logs...

Locations in computer memory are referenced by number. Most modern programs start with all references as 0 (Null), which points to nothing*. Then the program changes references to useful numbers as it puts data in memory. A NullReferenceException means that the program tried to use a reference it hadn't changed to point to useful memory yet. That can happen for a lot of different reasons, some of them outside of the developers' control.

With a large, interconnected program like KSP, NullReferenceExceptions can permeate throughout the program and mods, gradually leading to instability and crashes.

*That's better than pointing to a random location in memory because that would have random results. Trust me, it's no fun debugging a program that behaves differently every time there's an error. ;.;

Side note: At some point, I should really organize some tests to see how much memory KSP on Macs can really handle. I'm getting the impression it's less than 3.3 GB. In any case, that number assumes there's 3.3 GB leftover after accounting for other programs.

Link to comment
Share on other sites

Well, if malloc's failing that's a sign of no memory to allocate. Which, yes, is puzzling for <3GB, but eh.

Linux KSP x64 is quite stable (but follow the advice in the sticky in Stock support). The Windows x64 client is...."not" is an understatement.

And yes, you more or less should be able to just copy (or symlink!) the GameData folder and the Saves folder.

For the log, it's on the file system. Files>~/Library/Logs>Unity>Player.log (though I am not a Mac user; dunno quite what that means).

Null Reference Exceptions just mean you tried to invoke or set something on a null object. Consider:

Object foo = GetCorrectFoo();
foo.bar = "blam";

If GetCorrectFoo() does not return a valid object (say, it throws an exception itself, or there isn't a correct foo to be found and it returns null, or whatever) then the second line will throw a NRE (you did something to a reference [all objects in C# are referencs] that is null).

Link to comment
Share on other sites

For the log, it's on the file system. Files>~/Library/Logs>Unity>Player.log (though I am not a Mac user; dunno quite what that means).
It's in a hidden folder. From Finder: Go > Go to Folder... and type ~/Library/. Then go to Logs/Unity/ and you'll see Player.log.

Thanks guys. I found it, and I can zip it up in one file as you'd hope. Good to know. Ta. :)

Locations in computer memory are referenced by number. Most modern programs start with all references as 0 (Null), which points to nothing*. Then the program changes references to useful numbers as it puts data in memory. A NullReferenceException means that the program tried to use a reference it hadn't changed to point to useful memory yet. That can happen for a lot of different reasons, some of them outside of the developers' control.

With a large, interconnected program like KSP, NullReferenceExceptions can permeate throughout the program and mods, gradually leading to instability and crashes.

*That's better than pointing to a random location in memory because that would have random results. Trust me, it's no fun debugging a program that behaves differently every time there's an error. ;.;

Null Reference Exceptions just mean you tried to invoke or set something on a null object. Consider:

Object foo = GetCorrectFoo();
foo.bar = "blam";

If GetCorrectFoo() does not return a valid object (say, it throws an exception itself, or there isn't a correct foo to be found and it returns null, or whatever) then the second line will throw a NRE (you did something to a reference [all objects in C# are referencs] that is null).

You guys obviously know your stuff! Thanks again for teaching me. All interesting. :)

Side note: At some point, I should really organize some tests to see how much memory KSP on Macs can really handle. I'm getting the impression it's less than 3.3 GB. In any case, that number assumes there's 3.3 GB leftover after accounting for other programs.

I suspect you'll find it's 2.96GB. That's what Activity Monitor says KSP gets to just before I get out of memory errors. I've been tracking that for a few weeks actually...

Linux KSP x64 is quite stable (but follow the advice in the sticky in Stock support). The Windows x64 client is...."not" is an understatement.

And yes, you more or less should be able to just copy (or symlink!) the GameData folder and the Saves folder.

I'll give the Linux option a go. Cheers! ;)

Well, if malloc's failing that's a sign of no memory to allocate. Which, yes, is puzzling for <3GB, but eh.

Well, 2.96GB is pretty close to 3GB.

Thanks again to you both. I'll test it out on Linux and will report back if I have further issues. :P

Ta.

Link to comment
Share on other sites

By the way, simply copy-pasta'ing (or sym-linking) my mod data should work fine under Linux, right? Mod files are identical regardless of OS, yeah? Or should I go and look at all those mod forum posts again and check?

Link to comment
Share on other sites

Copying it should work unless part of the problem is installation or data corruption. Either Module Manager or KSP has issues with symlinks (haven't tracked down which). Most mods support all three platforms out of the box, and I don't know of any that support Macs, but not Linux.

Link to comment
Share on other sites

Copying it should work unless part of the problem is installation or data corruption. Either Module Manager or KSP has issues with symlinks (haven't tracked down which). Most mods support all three platforms out of the box, and I don't know of any that support Macs, but not Linux.

if that's true then it would be KSP. Module Manager operates on ConfigNodes already loaded into memory by KSP.

Link to comment
Share on other sites

Uhh, unfortunately I've hit a snag on the Linux idea.

Specifically, during the first loading screen (when KSP loads all the mods), it just hangs when loading a part from a mod, i.e. StationScience/Parts/StnSciZoo/model

So I deleted that mod and retried... which is a pain 'cause the space station I mentioned in OP wouldn't exist if not for that mod. -.-

Anyway, the reason I'm not posting this in the Station Science mod forum is because the issue happened again even after removing that mod, except this time, KSP hangs on a Squad part: Squad/Spaces/mk1PodCockpit/model

Then I removed all mods (keeping only the NASAMission and Squad folders in \GameData\ ) and it loads fine.

Things get even more curious when I go to the player.log - it has only two lines total:

PlayerPrefs - Creating folder: /home/david/.config/unity3d/SQUAD

PlayerPrefs - Creating folder: /home/david/.config/unity3d/SQUAD/KSPLauncher

That's it. That's the entire log.

...that's after about two minutes of Active Texture Reduction doing its thing, and the mod update checker doing its thing, and all sorts of other stuff going on...

...seems like the Linux 64-bit version isn't writing to the player.log file?? :S

That said, the ksp.log file is being written to just fine, and I see there is an error with Station Science, and will contact the dev thereof. But that doesn't explain why the Squad mk1PodCockpit model caused a hang despite Station Science being uninstalled.

EDIT: in case anyone finds this post in the future through a search and wonders how I get on with the dev(s) at Station Science, I have posted here.

Edited by DavidHunter
Added link to Station Science thread post
Link to comment
Share on other sites

Copying it should work unless part of the problem is installation or data corruption. Either Module Manager or KSP has issues with symlinks (haven't tracked down which). Most mods support all three platforms out of the box, and I don't know of any that support Macs, but not Linux.

Thanks for that advice. Ended up just copy-pasting. I've got several TB of spare space, what's 500mb of mods? ;)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...