Jump to content

1.0 - Constant crashing on OS X


Recommended Posts

Those workarounds helped noticeably - it's still crashing, but it seems to be far less often. A frequent one is right after splashdown, when you click "Recover Vessel" . Fortunately it auto-saves right then.

Link to comment
Share on other sites

Hey everyone,

I'm a relatively new user, and also on a mac. My game has been crashing occasionally since I got it, and I was able to find a graphics setting combination that let my computer run KSP without crashing for at least a few hours. After realizing that I never updated to 1.0.4, I updated it and lost my graphics settings (I think because I downloaded the new version from the site and copied my saves over rather than updating it some other way, this was the only way that seemed to work). Now the game could crash as often as every few minutes, (so far while flying low over Kerbin, when going back to KSC or into a different building). I've tried to read over the last few pages of this thread to get an idea of what I could do, but I think it would be best for me to just ask. I am not even sure if it's KSP, as my computer is 3 years old and has been through a lot of traveling to and from university, as well as to the ground, without landing gears. I also think my system specs might be on the lower end of what KSP requires.

Could someone help me figure out where I stand in system specs (if they might be causing some issues and I really should lower settings). I am also graduating this next year, and I have a birthday coming up, so I'm considering getting a new computer, (hopefully a PC), is that a good idea, bad idea, or just won't help or hurt.

Here are my system specs:

OS: 10.10.3

MacBook Pro (Retina, Mid 2012)

Processor: 2.6 GHz Intel Core i7

Memory: 8 GB 1600 MHz DDR3

Graphics: NVIDIA GeForce GT 650M 1024 MB

I know I've seen people post more specs of their computers, but I don't know where to find them, sorry about that.

Link to comment
Share on other sites

I think your specs are more then reasonable. In the past I played KSP on much worse.

KSP on OSX seems seriously bugged. I have the same issue, crashes, mostly during scenery changes.

Agreed. It really is damaging my experience and I can't really be bothered with KSP if it just keeps crashing every 10 minutes (no, seriously, I'm not exaggerating). I know it's a lot of work to do, but the devs must at least do something to try and fix these issues.

Link to comment
Share on other sites

Tom,

Try the tweaks listed in this thread. They really do help. I'm pretty much able to play without crashing, unless I do something really stupid like have a bunch of windows open and then try to change scenes. I play with about 20 mods, including KIS, KAS and a bunch of parts packs, and while my graphics res isn't ideal, I can at least play for several hours without disruption.

///on another note///

I noticed something new this morning. I have a memory monitor app installed, so I can keep an eye on my system memory. I generally hover around ~6gb free space when I'm not doing anything, but after a KSP hang yesterday that required a force kill, I noticed my free memory never recovered. It was hovering around 1.5gb with nothing open. I force killed everything and didn't see any improvement. So I started nosing around in activity monitor and there was nothing in the memory usage tab, but under the CPU tab were two instances of KSP, one of which was running at about 55% CPU usage. I forced them to die, and immediately recovered the missing memory.

So thought for the day - if you have a KSP hangup and force kill the app, go into activity monitor and look for lingering processes and kill them too. Otherwise, it seems like you get into a spiral of diminishing returns that leads to eventually running out of memory.

Link to comment
Share on other sites

I looked at my activity monitor and found a similar CPU usage, so I killed it like JJE64 suggested. In order for my computer to run normally when KSP isn't launched, should I be killing that process every time I exit?

Also, I am considering opening KSP in low resolution and installing active texture management, but I have a few questions about them. Does opening KSP in low resolution just reduce the resolution of the entire game, beyond what is done by adjusting the settings in game? In layman's terms, what exactly does Active Texture Management do? I understand that it reduces graphics quality in some way, but it says it "compresses textures", "generates minimaps", and "resizes textures/maps", and I honestly don't know what all of that means. I would just like to know what it is before I download it, and not just follow someone's advice blindly, even if they are highly regarded in the community. Sorry for having so many questions.

Link to comment
Share on other sites

I looked at my activity monitor and found a similar CPU usage, so I killed it like JJE64 suggested. In order for my computer to run normally when KSP isn't launched, should I be killing that process every time I exit?

Also, I am considering opening KSP in low resolution and installing active texture management, but I have a few questions about them. Does opening KSP in low resolution just reduce the resolution of the entire game, beyond what is done by adjusting the settings in game? In layman's terms, what exactly does Active Texture Management do? I understand that it reduces graphics quality in some way, but it says it "compresses textures", "generates minimaps", and "resizes textures/maps", and I honestly don't know what all of that means. I would just like to know what it is before I download it, and not just follow someone's advice blindly, even if they are highly regarded in the community. Sorry for having so many questions.

Okay... first question about killing the KSP process... I've only noticed the phantom KSP process when I have to force quit the game after it hangs. So that's when you'll want to do that. If I quit normally, it looks like everything goes back to normal.

As far as running in low res- as I understand it, all that does is disable Retina for that window and allows it to run in normal resolution. As I understand the way that retina works, basically it's a super high resolution screen that scales down to normal resolutions to proceed really high-fidelity graphics. Basically, the pixels on the screen are smaller, so you can use more of them to draw and create finer resolution images. Running in low res basically disables that and allows KSP to run under a normal resolution. A conflict appears to be occurring for retina users because of the way OS X packs graphics in a retina display.

As far as ATM - there is some debate if it's worth using right now. I think it is. What it does, in a nutshell, is take standard graphics formats (jpg, bmp, png) and compresses them on the fly into more a more efficient format - DDS - that eats less memory. Think of it this way, if you have a jpg image that's 128x128 - and jpg's store data at 24 bits per pixel (8bits for red, 8 for green, 8 for blue), that's 128 * 128 * 24, that's 393,216 bits per image. At 8 bits/byte, that comes to 49k per texture file.

In comparison, DDS only uses 5 bits per color channel, so you get 128 * 128 * 15 = 245,760 bits per image, or 30k per texture file.

The real benefit comes when your jpg files are 512x512 or 1024x1024 and you use aggressive ATM to reduce them to 128x128. A 512x512 jpg would be 6,291,456 bits, or 786k per texture file. Compare that to 30k per texture file. There's quite a bit of savings there. This doesn't even begin to touch on DXT compression.

For your eyes, you won't see hardly any difference between jpg texture maps and DDS texture maps. In fact, most mod designers are already using DDS, which is why ATM might be a moot point. For those who aren't, however, there is some memory savings to be gained from using it.

Link to comment
Share on other sites

I opened it in low resolution mode and I think I got 2 hours of playing time without a crash. I will download ATM later to test it out, as it says the first load may take hours.

The crash happened when I was trying to pull up my resources tab, while on a mission. It's kind of odd to say, but I think the tabs in the upper right corner (funds/rep/sci, contracts, and resources) may be related to the crashes, as I'm often crashing when trying to open one up. Does anyone else experience this problem?

Thanks for the explanations JJE64! :)

Link to comment
Share on other sites

DannyS - Yes, I also experience crashes when pulling up my resources tab. Most of the time my crashes seem to be related to "switching screens", i.e. going to the space center from the flight view, etc. I haven't been able to get it reliably working (even with ATM), and I have resorted to dual-booting ubuntu

Link to comment
Share on other sites

... The crash happened when I was trying to pull up my resources tab, while on a mission. It's kind of odd to say, but I think the tabs in the upper right corner (funds/rep/sci, contracts, and resources) may be related to the crashes, as I'm often crashing when trying to open one up...
This won't help you at all right now, but, if pulling up different tabs / info screens is sometimes pushing over the edge into a crash, the next major update (v1.1) might help. It's months away, though. Today, depending which bit of info you are viewing, it might be travelling over one of three different user interface code paths. Squad is rewriting all of that different user interface code, consolidating it into a single UI system.
Link to comment
Share on other sites

My crashes are:

80% when switching between a screen and the space centre (ie. flight and space centre, or VAB and space centre)

10% when flying a big spacecraft - large, many parts, many stagings

10% random when building craft

I sometimes can play for 2 hours non stop and then get three crashes within 20 minutes. It seems very random.

I've tried using memory clean every now and then, and I can't say if it works or not.

Link to comment
Share on other sites

  • 2 months later...

I was really considering just quit playing, but now when I see that people see it as a normal (and still playing) I might give it a second change and try to fix it.

So, here end of my Player.log:


activating stage 3 - current stage: 4

(Filename: /Users/builduser/buildslave/unity/build/artifacts/MacStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)


[00:05:28]: Separation of stage 4 confirmed

(Filename: /Users/builduser/buildslave/unity/build/artifacts/MacStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)


[stackDecoupler]: Activated

(Filename: /Users/builduser/buildslave/unity/build/artifacts/MacStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)


Game Paused!

(Filename: /Users/builduser/buildslave/unity/build/artifacts/MacStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)


[HighLogic]: =========================== Scene Change : From FLIGHT to FLIGHT =====================

(Filename: /Users/builduser/buildslave/unity/build/artifacts/MacStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)


[PlanetariumCamera]: Focus: Kerbin

(Filename: /Users/builduser/buildslave/unity/build/artifacts/MacStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 56)


UnloadTime: 19.539150 ms
KSP(70151,0xa07fd1d4) malloc: *** mach_vm_map(size=4194304) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Receiving unhandled NULL exception
Obtained 28 stack frames.
#0 0x00000001395e3d in array_push_back
#1 0x00000001396651 in mono_add_process_object
#2 0x0000000139628b in mono_unity_liveness_calculation_from_statics
#3 0x000000002ea948 in GarbageCollectSharedAssets(bool)
#4 0x0000000030b902 in CleanupAfterLoad()
#5 0x000000002efe45 in LevelLoading::LoadLevel(int, std::string const&, AwakeFromLoadQueue&)
#6 0x000000002efad7 in PlayerLoadLevelFromThread(int, std::string const&, AwakeFromLoadQueue&)
#7 0x000000002f4c91 in PreloadLevelOperation::IntegrateMainThread()
#8 0x000000002f3cdb in PreloadManager::UpdatePreloadingSingleStep(bool)
#9 0x000000002f4308 in PreloadManager::WaitForAllAsyncOperationsToComplete()
#10 0x000000002f1e14 in PlayerLoop(bool, bool, IHookEvent*)
#11 0x0000000065e65c in -[PlayerAppDelegate UpdatePlayer]
#12 0x0000009651376f in __NSFireTimer
#13 0x00000090e1c006 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
#14 0x00000090e1bab4 in __CFRunLoopDoTimer
#15 0x00000090e9754f in __CFRunLoopDoTimers
#16 0x00000090dd3531 in __CFRunLoopRun
#17 0x00000090dd2aa6 in CFRunLoopRunSpecific
#18 0x00000090dd290b in CFRunLoopRunInMode
#19 0x0000009bef78f8 in RunCurrentEventLoopInMode
#20 0x0000009bef7503 in ReceiveNextEventCommon
#21 0x0000009bef742c in _BlockUntilNextEventMatchingListInModeWithFilter
#22 0x0000009131ab41 in _DPSNextEvent
#23 0x0000009131a1e5 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#24 0x0000009130eb9c in -[NSApplication run]
#25 0x00000091283fa0 in NSApplicationMain
#26 0x0000000065e3ab in PlayerMain(int, char const**)
#27 0x00000000003095 in start
Stacktrace:




Native stacktrace:


0 libsystem_kernel.dylib 0x938fe69a __pthread_kill + 10
1 libsystem_c.dylib 0x9bcf6dee abort + 156
2 KSP 0x0034a822 _Z12HandleSignaliP9__siginfoPv + 34
3 libmono.0.dylib 0x0139481a mono_chain_signal + 76
4 libmono.0.dylib 0x012deae2 mono_sigsegv_signal_handler + 234
5 libsystem_platform.dylib 0x9a4e803b _sigtramp + 43
6 ??? 0xffffffff 0x0 + 4294967295
7 libmono.0.dylib 0x01396651 mono_add_process_object + 115
8 libmono.0.dylib 0x0139628b mono_unity_liveness_calculation_from_statics + 516
9 KSP 0x002ea948 _Z26GarbageCollectSharedAssetsb + 3128
10 KSP 0x0030b902 _Z16CleanupAfterLoadv + 18
11 KSP 0x002efe45 _ZN12LevelLoading9LoadLevelEiRKSsR18AwakeFromLoadQueue + 869
12 KSP 0x002efad7 _Z25PlayerLoadLevelFromThreadiRKSsR18AwakeFromLoadQueue + 39
13 KSP 0x002f4c91 _ZN21PreloadLevelOperation19IntegrateMainThreadEv + 65
14 KSP 0x002f3cdb _ZN14PreloadManager26UpdatePreloadingSingleStepEb + 299
15 KSP 0x002f4308 _ZN14PreloadManager35WaitForAllAsyncOperationsToCompleteEv + 136
16 KSP 0x002f1e14 _Z10PlayerLoopbbP10IHookEvent + 708
17 KSP 0x0065e65c -[PlayerAppDelegate UpdatePlayer] + 252
18 Foundation 0x9651376f __NSFireTimer + 119
19 CoreFoundation 0x90e1c006 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
20 CoreFoundation 0x90e1bab4 __CFRunLoopDoTimer + 1316
21 CoreFoundation 0x90e9754f __CFRunLoopDoTimers + 351
22 CoreFoundation 0x90dd3531 __CFRunLoopRun + 2081
23 CoreFoundation 0x90dd2aa6 CFRunLoopRunSpecific + 390
24 CoreFoundation 0x90dd290b CFRunLoopRunInMode + 123
25 HIToolbox 0x9bef78f8 RunCurrentEventLoopInMode + 262
26 HIToolbox 0x9bef7503 ReceiveNextEventCommon + 192
27 HIToolbox 0x9bef742c _BlockUntilNextEventMatchingListInModeWithFilter + 99
28 AppKit 0x9131ab41 _DPSNextEvent + 742
29 AppKit 0x9131a1e5 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 350
30 AppKit 0x9130eb9c -[NSApplication run] + 907
31 AppKit 0x91283fa0 NSApplicationMain + 2082
32 KSP 0x0065e3ab _Z10PlayerMainiPPKc + 731
33 KSP 0x00003095 start + 53


Debug info from gdb:




=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================


KSP(70151,0xa07fd1d4) malloc: *** error for object 0xebb51000: Can't deallocate_pages region
KSP(70151,0xa07fd1d4) malloc: *** set a breakpoint in malloc_error_break to debug
KSP(70151,0xa07fd1d4) malloc: *** error for object 0xe8b87000: Can't deallocate_pages region
KSP(70151,0xa07fd1d4) malloc: *** set a breakpoint in malloc_error_break to debug
KSP(70151,0xa07fd1d4) malloc: *** error for object 0x1bc99000: Can't deallocate_pages region
KSP(70151,0xa07fd1d4) malloc: *** set a breakpoint in malloc_error_break to debug
ipcserver restart: expected: 104, got: 0
KSP(70151,0xa07fd1d4) malloc: *** error for object 0xefcd1000: Can't deallocate_pages region
KSP(70151,0xa07fd1d4) malloc: *** set a breakpoint in malloc_error_break to debug
KSP(70151,0xa07fd1d4) malloc: *** error for object 0xf2b68000: Can't deallocate_pages region
KSP(70151,0xa07fd1d4) malloc: *** set a breakpoint in malloc_error_break to debug

As you can see from last normal entries I've been switching view from ongoing flight to start of the flight.

Here is the full log: https://www.dropbox.com/s/hvtr3vkrbztew1n/Player_11.10.2015_morning_1.log?dl=0

- - - Updated - - -

Ok, Here is another one. This time Reason is completely obvious:


KSP(70374,0xb0b49000) malloc: *** mach_vm_map(size=1085440) failed (error code=3)*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
DynamicHeapAllocator out of memory - Could not get memory for large allocationCould not allocate memory: System out of memory!
Trying to allocate: 1068072B with 16 alignment. MemoryLabel: FMODSample
Allocation happend at: Line:122 in
Memory overview

My system is:


Model Name: MacBook Pro
Model Identifier: MacBookPro11,3
Processor Name: Intel Core i7
Processor Speed: 2.3 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 6 MB
Memory: 16 GB

With two video options:


Chipset Model: Intel Iris Pro
Type: GPU
Bus: Built-In
VRAM (Dynamic, Max): 1536 MB
Vendor: Intel (0x8086)

and


Chipset Model: NVIDIA GeForce GT 750M
Type: GPU
Bus: PCIe
PCIe Lane Width: x8
VRAM (Total): 2048 MB
Vendor: NVIDIA (0x10de)


Full log file: https://www.dropbox.com/s/ewcot3d3mmpycjj/Player_11.10.2015_morning_2.log?dl=0

Edited by Master Tao
Link to comment
Share on other sites

I have almost the exact same mac, and for the most part the crashes have gone away completely. Hang in there - and follow the recommendations on this thread. I don't even know exactly which one worked, but I can play for hours now withouth crashing.

Link to comment
Share on other sites

Today I solved a rather annoying memory leak in software I built. It reminded me of some of the problems we have with KSP on a Mac.

KSP is based on Unity. Unity runs on Mono. Mono may have been compiled on GCC. Software compiled on GCC uses glibc. The multithreaded implementation of malloc() and free() in glibc wastes memory under some circumstances.

In short, small (by default smaller than 128 kB) memory allocations done by threads other than the main thread are typically served from so-called arenas. An arena is a smallish memory region (1 MB on 32-bit systems), so there are usually many arenas at the same time. When a thread tries to allocate memory, it cycles through all arenas, starting from the one where it last allocated memory successfully, until it finds one where the request can be served. If all arenas (where the thread could acquire mutex) are full, a new arena is created. When a thread calls free(), the deallocated region isn't really freed, unless it was the highest allocated region in an arena.

If there are many small allocations and deallocations, the end result is a lot of fragmented arenas with unallocated regions inside them. Because many free() calls don't actually free the memory, while many malloc() calls don't fit in the holes in the existing arenas, memory usage tends to grow slowly over time. This isn't really a memory leak, because everything is under control, but it certainly looks like one.

I don't know whether this is the real cause of the memory leak in KSP, but it could explain the symptoms.

Link to comment
Share on other sites

  • 3 months later...

I just solved this issue on my machine, and I guess people would like to know how.

I read a bit about Unity crashing issues in general, and I read that certain very old fonts could cause Unity crashes, and this led me to look in my user font library, only to see this:

Andrews-iMac:FontCollections andrewmcgregor$ ls -l

total 136

-rw-------+ 1 andrewmcgregor  staff   1341 18 Oct  2004 Chinese.collection

-rw-------+ 1 andrewmcgregor  staff    899 18 Oct  2004 Classic.collection

-rwx------+ 1 andrewmcgregor  staff   2380 26 Jul  2012 Fixed Width.collection

-rw-------+ 1 andrewmcgregor  staff    872 18 Oct  2004 Fun.collection

-rw-------+ 1 andrewmcgregor  staff   2477 18 Oct  2004 Japanese.collection

-rw-------+ 1 andrewmcgregor  staff   1217 18 Oct  2004 Korean.collection

-rw-------+ 1 andrewmcgregor  staff    815 18 Oct  2004 Modern.collection

-rw-------+ 1 andrewmcgregor  staff    856 18 Oct  2004 PDF.collection

-rw-------+ 1 andrewmcgregor  staff   1164 18 Oct  2004 Web.collection

-rw-rw----+ 1 andrewmcgregor  staff  23606  3 Dec  2007 Windows Office Compatible.collection

-rw-------+ 1 andrewmcgregor  staff   1492  7 Dec  2007 com.apple.Favorites.collection

-rw-------+ 1 andrewmcgregor  staff   2969 14 Jul  2011 com.apple.Recents.collection

 

Now, that looks a bit suspicious... those are the fonts from Microsoft Office way back when, since my OS install has been upgraded and ported to different machines since about 2003.

So I deleted them, and a bunch of similarly old fonts here:

Andrews-iMac:Fonts andrewmcgregor$ ls -l

total 1792

-rwxr-xr-x@ 1 andrewmcgregor  staff      0  8 Apr  2004 Brush Script

-rw-r--r--+ 1 andrewmcgregor  staff  36284 17 Feb  2005 FTL_____.TTF

-rw-r--r--+ 1 andrewmcgregor  staff  35968 17 Feb  2005 FT______.TTF

-rwx------+ 1 andrewmcgregor  staff  41416 20 Oct  2004 OptimusPrinceps.ttf

-rwx------+ 1 andrewmcgregor  staff  57296 20 Oct  2004 OptimusPrincepsSemiBold.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  65932 25 Apr  2005 Vera.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  63208 25 Apr  2005 VeraBI.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  58716 25 Apr  2005 VeraBd.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  63684 25 Apr  2005 VeraIt.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  55032 25 Apr  2005 VeraMoBI.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  49052 25 Apr  2005 VeraMoBd.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  54508 25 Apr  2005 VeraMoIt.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  49224 25 Apr  2005 VeraMono.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  60280 25 Apr  2005 VeraSe.ttf

-rw-r--r--+ 1 andrewmcgregor  staff  58736 25 Apr  2005 VeraSeBd.ttf

-rw-r--r--+ 1 andrewmcgregor  staff   4268  9 Apr  2012 encodings.dir

-rw-r--r--+ 1 andrewmcgregor  staff   5523  9 Apr  2012 fonts.dir

-rw-r--r--+ 1 andrewmcgregor  staff    810  9 Apr  2012 fonts.list

-rw-r--r--+ 1 andrewmcgregor  staff   5523  9 Apr  2012 fonts.scale

-rw-r--r--+ 1 andrewmcgregor  staff  51220 25 Apr  2005 opens___.ttf

 

Lo and behold, KSP is now stable, whereas before I did that it would crash instantly on trying to launch.

Link to comment
Share on other sites

  • 1 month later...

This solution fixed it for me:

https://www.reddit.com/r/KerbalSpaceProgram/comments/3laqnf/psa_ksp_64_bit_works_on_mac_os_x/

It's a little bit of a puzzle. The version 4.6.4 of unity can be found by click download unity 5 and then clicking older versions of unity. It's the unity editor. No more crashing. And it's running rather well too!

Squad should implement this "fix"!

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...