12 ms·
Fix random few-second freezes in Mountain Lion
- rangibaby 14y agoThis fix is for a sandboxing bug in the first releases of 10.8.2 and 10.7.5[1]. Updating your OS to the latest version can also remedy the problem. [1] http://support.apple.com/kb/dl1599 http://support.apple.com/kb/dl1599
- swombat 14y agoI've used the alternative method of editing system.sb - because I'm not scared of editing system files, heh. To test whether you have the problem, open the Console (under Others in launchpad) and search for the string "mdworker".
- danso 14y agoHmmm...I wonder if this is my roommate's problem. Last year I gave her my 2008 Macbook Pro (a fully decked-out one at the time) because her 8 year old iMac broke...and she has been complaining constantly about how slow it is. She incessantly curses out the beach ball and will slam the mouse down repeatedly because she swears it makes the ball go away faster. Because of that last bit, I've never taken her seriously. That laptop was working fine when I was using it for Photoshopping raw images while having 15 browser windows open...her use-case is literally to have something to check GMail with and sometimes listen to her iTunes collection. I've gone into the laptop several times to make sure there isn't bloatware on it, and have disabled every extraneous feature...and yet she still has the few-second freezes issue (and I've been unable to reproduce it)....Hopefully this is the solution to both of our problems.
- aidos 14y agoI don't think it sounds like the same thing - though, if you find the solution to your roommate's issue I'd love to hear it. I have a new (< 6 months) Mac Mini running ML and it's infuriatingly slow opening applications. It's not unusual to wait 10-15 seconds after clicking to open Chrome or Spotify (or anything else). My 5 year old MacBook does the same thing in a fraction of the time (running SL).
- coldtea 14y agoAre you people writing this technical / developers? I mean, have you tried obvious things to find what's at fault? Like "Activity Monitor", "fs_usage" and such? Have you checked if you have apps that install kernel hacks? Or some badly written memory hog app installed in the menubar to run all the time? A < 6 months Mac Mini should have no such issues.
- aidos 14y agoYes - looked at all the obvious things you mentioned (though I hadn't seen fs_usage before, very useful, will see if that shows anything up). There's virtually nothing installed on the box - we stream pretty much everything and it's only used as a media center style machine. I've made an appointment with the genius bar to see if they can shed some light on the issue.
- coldtea 14y agoWell, since you already tried the most techy things, then yes, the Apple service is your best bet.
- swombat 14y agoThe beach ball is a different issue... this is basically a complete freeze where the mouse cursor doesn't move for a few seconds. Doesn't happen all that often, but it's quite annoying whenever it does happen.
- workbench 14y ago
- JonnieCache 14y agoIs that a lisp config file? Blimey. Is this common in OSX land? I'm somewhat skeptical that this will fix the random beachballing, because I'm pretty sure I've been seeing that since before ML. The fact that I put up with it is testimony to how badly windows and (desktop) linux suck. EDIT: tried the config edit and rebooted, not seeing the "deny mach-lookup" error any more but I am still seeing regular "Unable to talk to lsboxd" messages. I guess I'll try the safemode thing later. EDIT2: another thing I've done in my quest to banish the beachball is to uninstall iStat Menus. I'm sure there are many others here who use it. It was causing lots of crazy behaviour in the SystemUIServer process. Now I've binned it, things seem better. It's a shame, I liked those graphs. Anyone know another tool that can show me per-process bandwidth usage?
- joethompson 14y agoAll the sandbox entitlement files are written in that scheme-like syntax, but it's limited to that in OS X as far as I've seen.
- Hemospectrum 14y agoIt seems to be an actual Lisp-1 dialect, not just Scheme-like syntax. In (Lion's version of) application.sb, there are a whole bunch of lambdas and letrecs flying around. They even define a macro.
- joethompson 14y agoInteresting, I never really dug too deep into it, aside from making a couple of changes and standard entitlement stuff for applications. application.sb looks like a complete nightmare to maintain.
- msbarnett 14y agoIt's specifically TinyScheme, with one every-so-small modification to the parser. This PDF goes into it in some detail: http://securityevaluators.com/files/papers/apple-sandbox.pdf http://securityevaluators.com/files/papers/apple-sandbox.pdf
- fredleblanc 14y agoI didn't fully realize that I had this issue (I mean, I saw freezes, just assumed it was Photoshop or something causing it). Did the reboot fix and things seems to have worked. Whereas before mdworker errors were entering the console every 2-3 minutes, it's been 30 since I did the reboot and haven't seen an mdworker error since.
- lukeholder 14y agosame here, thought it was photoshop. My computer doesn't do the freeze anymore. This is awesome.
- dpedu 14y agoHoly hell, my 2012 Macbook Air does this! Its pretty irritating but I had been taking it as a fact of life.
- rexf 14y agoSame for my 2011 Air, I was thinking about formatting and re-installing OS X. Not sure I can reliably reproduce the few-second freeze in OS X, but it does happen (and is very noticeable when it occurs).
- nicholassmith 14y agoI've had a few issues with ML locking up, some seem to be from this, others are from graphics updates being suspended. It's almost enough to push me back to SL honestly, but I need the later versions of XCode. Very annoying.
- NelsonMinar 14y agoI'm pretty handy with Unix but this problem and fix seem like pure magic. What problem with Spotlight indexing / Time Machine could cause the entire GUI to lock up in the first place? I'm used to random Apple apps like Finder and iTunes beachballing because they are badly written, but the whole OS? The "alternative fix" hidden text at least explains why booting Safe Mode might magically fix things; it's "rebuilding things and clearing caches". What a mess.
- JonnieCache 14y agoThe idea that a kernel-level process sandboxing system getting confused could freeze the GUI seems pretty legit to me.
- NelsonMinar 14y agoI suppose so, but that's a pretty severe bug. The whole sandboxing system is pretty controversial in the first place, the idea that bugs in it are causing users' GUIs to lock up is pretty horrible.
- coldtea 14y agoWell, it's not like millions of users are in tears all around the country. I for one, have had no such problem. Bugs happen, anyway, it will be fixed in a subsequent update.
- ars 14y agoSo the entire fix is basically to reboot to safe mode, then back out of it? How does that fix anything?
- Watabou 14y agoRead the apple page on safe mode. It performs several checks which most likely fix the problem.
- coldtea 14y agoBecause safe mode is a different runlevel (IIRC), it gets the chance to run some maintenance scripts, delete caches, etc, uninhibited by some services that are loaded in normal mode.
- euroclydon 14y agoDoes "clear the console" mean open the terminal and type clear, or something else?
- lobster_johnson 14y agoIt refers to the Console app, which has a "Clear Display" button.
- lobster_johnson 14y agoI have a brand new 2013 model MBP (Retina display, 16GB RAM, Apple SSD) running Mountain Lion. I actually upgraded because my 2011 model was getting these freezes, and I assumed it was a hardware problem. But my new MBP has been sluggish from day one. That is, from the moment I migrated my user files from my old box. It's possible that I got some stuff that affects performance. Three things helped: * First, disabling the dynamic pager [1]. This one has a dramatic effect on performance. In theory, it will prevent OS X from swapping out apps unnecessarily (which it will do even when the apps are active and there is plenty of RAM). I did have some, but not much, swapping going on, but it still improved performance. * Secondly, I uninstalled iStat Menus. I can't be sure that this contributed to the performance problems, but I won't risk reinstalling to find out. It seems to have helped a bit. * Thirdly, I disabled Spotlight indexing of my home directory. This way Alfred will still autocomplete apps. Some apps lose their search functionality, but I never use Spotlight, and I find that I can live without it. I tried the sandbox config fix, but it made no difference to me. The remaining sluggishness seems to come from the graphics layer. For example, doing the Exposé "reveal all windows" command takes 3-4 seconds on my box and has a frame rate of approximately 1 fps. It's not great. I notice the reduced graphics performance when scrolling pages in Chrome, whereas Safari is smoother. I suspect this is Retina being a bit too ambitious compared to actual current graphics card performance. As an aside, I believe OS X's I/O system has traditionally been its weak point, being a Mach-based hybrid-microkernel architecture. You can cause GUI scheduling problems by overloading the I/O system, and it's possible that this is exacerbated by having a SSD.
- habosa 14y agoIt must be something else going on. The Expose features should not be nearly that slow. My mid - 2010 Macbook with wayyyyy too many applications installed is still butter smooth on most animations.
- rangibaby 14y agoWhen you are trying to push 100% more pixels with only around 20% more GPU grunt, you're going to have lag. I have a feeling that the animations would be a lot smoother (and battery life a lot shorter) if the GP forced their laptop to use the dedicated graphics card. [1] GT330M benchmark (2010 Macbooks) http://www.videocardbenchmark.net/gpu.php?gpu=GeForce+GT+330M http://www.videocardbenchmark.net/gpu.php?gpu=GeForce+GT+330... [2] Intel HD4000 benchmarks (2012~ Macbooks) http://www.videocardbenchmark.net/gpu.php?gpu=Intel+HD+4000 http://www.videocardbenchmark.net/gpu.php?gpu=Intel+HD+4000
- guylhem 14y agoThis problem is due to the protection, the sandboxing. Various approaches have been suggested on the online forums, including editing the config files to be more lenient about these protections (the so called "alternative approach" proposed by the poster) I tried them all, never had any result. I almost gave up, then read about that safe mode reboot suggestion. I have long uptimes and I don't want to bother reopening stuff, so I didn't do it immediately. But finally I did, and it worked. Based on the timestamp of my blog (http://en.blog.guylhem.net/ http://en.blog.guylhem.net/) I tried that on mar 31, about 1 month ago, and here are the results from the syslog so far (1 month of data after the fix): # bzgrep sandboxd /var/log/system.log*|grep deny|sed -e 's/.*bz2://g'|sort|wc 97 1441 18032 About 97 issues of sandboxing zealousness remain, if we distinct them by removing the PIDs with : # bzgrep sandboxd /var/log/system.log*|grep deny|sed -e 's/.*macbookair//g' -e 's/[0-9]*//g' |sort|uniq kernel[]: Sandbox: sandboxd() deny mach-lookup com.apple.coresymbolicationd .guylhem.org sandboxd[] ([]): Preview() deny file-read-data /Users/guylhem/C/abcdef.jpeg .guylhem.org sandboxd[] ([]): Preview() deny file-write-data /Users/guylhem/C/abcdef.jpeg .guylhem.org sandboxd[] ([]): QuickLookSatelli() deny file-read-data /Users/guylhem/Desktop/Wolfram Science Summer School Application_files/.css .guylhem.org sandboxd[] ([]): QuickLookSatelli() deny mach-lookup com.apple.PowerManagement.control .guylhem.org sandboxd[] ([]): TextEdit() deny mach-lookup com.apple.SystemConfiguration.SCNetworkReachability .guylhem.org sandboxd[] ([]): TextEdit() deny mach-lookup com.apple.tsm.portname .guylhem.org sandboxd[] ([]): TextEdit() deny system-socket .guylhem.org sandboxd[] ([]): VTDecoderXPCServ() deny file-read-data /Users/guylhem/Library/Preferences/.GlobalPreferences.plist .guylhem.org sandboxd[] ([]): mdworker() deny file-read-data /Library/Filesystems/NetFSPlugins () .guylhem.org sandboxd[] ([]): mdworker() deny file-read-data /Library/Filesystems/NetFSPlugins (pre-ls-info fstype:mtmfs fsflag: flags: diag: uti:com.apple.application-bundle plugin:/Library/Spotlight/Application.mdimporter - find suspect file using: sudo mdutil -t ) .guylhem.org sandboxd[] ([]): mdworker() deny file-read-xattr /Users/guylhem/Library/Application Support/Google/Chrome/Safe Browsing Bloom (pre-plugin fstype:hfs fsflag:D flags:E diag: uti:public.data plugin:internalPlainTextImporter - find suspect file using: sudo mdutil -t ) .guylhem.org sandboxd[] ([]): mdworker() deny mach-lookup com.apple.PowerManagement.control (import fstype:hfs fsflag:D flags: diag: uti:com.microsoft.excel.xls plugin:/Library/Spotlight/Microsoft Office.mdimporter - find suspect file using: sudo mdutil -t ) .guylhem.org sandboxd[] ([]): mdworker() deny mach-lookup com.apple.PowerManagement.control (import fstype:hfs fsflag:D flags: diag: uti:org.openxmlformats.presentationml.presentation plugin:/Library/Spotlight/Microsoft Office.mdimporter - find suspect file using: sudo mdutil -t ) .guylhem.org sandboxd[] ([]): mdworker() deny mach-lookup com.apple.PowerManagement.control (import fstype:hfs fsflag:D flags:E diag: uti:com.microsoft.excel.xls plugin:/Library/Spotlight/Microsoft Office.mdimporter - find suspect file using: sudo mdutil -t ) .guylhem.org.home sandboxd[] ([]): Preview() deny mach-lookup com.apple.SystemConfiguration.SCNetworkReachability .guylhem.org.home sandboxd[] ([]): Preview() deny system-socket .local sandboxd[] ([]): QuickLookSatelli() deny mach-lookup com.apple.PowerManagement.control .local sandboxd[] ([]): VTDecoderXPCServ() deny file-read-data /Library/Preferences/.GlobalPreferences.plist .local sandboxd[] ([]): fontworker() deny mach-lookup com.apple.ls.boxd This last one is interesting : # bzgrep com.apple.ls.boxd /var/log/system.log* /var/log/system.log.2.bz2:Apr 26 18:23:37 macbookair.local sandboxd[64] ([62]): fontworker(62) deny mach-lookup com.apple.ls.boxd lsboxd sqweaked only once in a month - and for something different. I'd call this "problem solved", which is supported by my personal observation over this last month : I haven't experienced the problem again yet, while previously it was at least every 2 days (along with the TimeMachine always reindexing) My suggestion: check your logs with the greps, try this simple fix and report your results in a month. EDIT: This in on my macbookair with a 480GB OWC SSD (but apparently it also occurs on macbookair with vanilla apple ssds). I used istat menus, and still do. I didn't disable the dynamic pager, spotlight or anything else. (EDIT2: removed) - thanks for the 4 spaces suggestion! as explained, the simple safe reboot solution made the problem go away, while other approaches didn't. It works for me, and I have 1 month of data supporting that.
- kstenerud 14y agoI get the freeze every time I plug in or remove a USB device. Hopefully this fix will work for me...
- randall 14y agoThe issue I've had is from not being able to use keyboard or mouse entry for some random (3-5 seconds?) amount of time. Anyone else seen that? rMBP, fwiw.
- ByronT 14y agoI began experiencing this problem on my mid-2008 MBP late last year. More recently, I've found that slipping a piece of paper between the battery and the golden electrical strip helps a lot.
- NelsonMinar 14y agoI have no idea if it's related, buy my mouse cursor sometimes freezes on a 2011 iMac running Lion. Lots of details (and no answers) at http://apple.stackexchange.com/questions/88211/cursor-stuttering-iohidsystem-cursor-update-overdue-resending http://apple.stackexchange.com/questions/88211/cursor-stutte...
- lobster_johnson 14y agoYes. Same here. It freezes and while I can type a little, it ends up "liiiiiiik tttttiis". Those freezes got a lot rarer after I disabled the dynamic pager [1]. I have only experienced it once since then. I have had vm_stat and iostat running constantly to see if I can catch any metrics when it happens, but nothing stands out. It's not related to excessive I/O or swapping. [1] https://news.ycombinator.com/item?id=5626835 https://news.ycombinator.com/item?id=5626835
- ktf 14y agoI'm seeing the same thing. This is my first real Mac experience, got it from/for work, wasn't sure if something like this was "normal". (I'm a long-time Linux user, so I'm used to putting up with a lot of bullshit from my desktop.) I've found a handful of forum posts and support requests, but no solution other than "it's probably a hardware defect and you should return it".
- nwh 14y agoDefinitely. I also lose the keyboard at the same time too though, so it's potentially a USB issue as well. Doesn't happen frequently enough that I'm able to work out exactly what causes it.
- UnoriginalGuy 14y agoThis whole thread is making me very pleased I didn't buy a Macbook Pro. It isn't the fact that stuff goes wrong that bugs me, it is the fact that seemingly both the problems and solutions are via "magic." Even people who claim to be very UNIX knowledgable have no idea what is going wrong... When Apple's stuff works it "just works." When Apple's stuff stops working then you're SOL.
- lucian1900 14y agoTheir sandboxing method is deeply flawed and it locks up core services.
- saidajigumi 14y agoIn my experience, this kind of thing is no different than any other system I've used over the years. Windows, Linux, OS X -- all of them end up with odd problems that require a bit of digging around the web to sort out. Singling out OS X as "then you're SOL" seems like FUD to me.
- obviouslygreen 14y agoWhen you have a problem in Linux, it may require some searching, but the solution usually makes sense at some level. Unless you're doing something very strange or bleeding edge, it's more likely that what you find won't be totally incomprehensible or inexplicable. As for Windows... just restart it, you'll be fine. ;)
- nwh 14y agoUsually true, but Linux hardware problems are another matter. If its FireWire based you just type random things from forum posts until something happens.
- diggan 14y agoYou really shouldn't write random things from internet in your terminal. Maybe the hardware problems is for the stereotypical consumer isn't interested in Linux if you compare to Windows and Mac OSX. Different story on server-hardware/software though.
- clobber 14y agoI've tried this and so far, so good! I'm rather annoyed as it seems like a simple "housekeeping" task that OS X should have already handled. When upgrading the OS, Apple always re-hides my user Library folder and wipes out my TRIM support kext for my "3rd party" SSD, but they cannot perform clean up like this? Very disappointing.
- ahknight 14y agoCan't safe boot with a Filevault 2 boot disk. Thanks, Apple! You get to decrypt the disk, safe boot, verify fix, then re-encrypt the disk. Apparently the boot loader can't pass a boot variable down after the transfer or something? Anyone have insight here?
- coldtea 14y ago>Can't safe boot with a Filevault 2 boot disk. Thanks, Apple! I'm sure they did it out of incompetence and/or spite, and not due to some security concern or technical issue.
- ahknight 14y agoWhen designing a new system-wide architecture like a new storage subsystem, edge cases matter. A lot. I'd call it, at best, an oversight in the design phase of CS-WDE and, at worst, incompetence.
- coldtea 14y agoEdge-cases happen. By definition. And some edge-cases are necessary trade offs. Without knowing MUCH MUCH more into the issue, I wouldn't call it neither oversight, nor incompetence.
- grayprog 14y agoIf you can't boot into Safe mode (I couldn't on a rMBP with 10.8.3), you can perform the following sequence to make it boot to Safe mode (source https://discussions.apple.com/message/21366643#21366643 https://discussions.apple.com/message/21366643#21366643): cd /sbin sudo mv fsck_hfs fsck_hfs_orig sudo cp -p /usr/bin/true fsck_hfs nvram boot-args="-x -v" reboot, log in sudo nvram boot-args="" reboot cd /sbin sudo mv fsck_hfs_orig fsck_hfs
- mitchty 14y agoWhy are you moving fsck_hfs around? I do notice if i'm booting into safe mode that fsck_hfs is taking FOREVER. (running 12 hours so far on my retina mbp 15, which is ludicrous) But just switching to single user (aka boot-args="-s -v") and manually running fsck_hfs -c 4096m -f -d /dev/disk1 (or equivalent) I managed to clean up / of a few problems in under 4 minutes. fsck_hfs looks like it could use some fixing to dynamically cache things better, that or they could give it default arguments based on the systems memory size to speed things along. Either way I'm done with trying to fix this, just going to reinstall 10.8.3 from scratch and rsync over my home directory and reinstall vmware. I've tried about every fix for the sandbox nonsense, and since this system had 10.7 originally maybe it upgraded badly, whatever.
- nixy 14y agoI know this might not be the best forum for this question, but since this thread currently has a lot of eyes on it I wanted to reach out and see if any one has experienced the same issue as me. I am on a mid-2011 Mac Mini and I upgraded to Mountain Lion when it was released. Ever since I have been plagued with a freezing issue which is way worse than described by the OP. What happens, 10-20 times per workday is the following: I am in my workflow coding, sending e-mail, using Photoshop etc At any seemingly random time, the app(s) I am using will become unresponsive Soon after the Beachball appears and I cannot interact with most apps After a period of time, usually between 10 seconds and 15 minutes (yes, minutes), everything un-freezes and goes back to normal When the freezing happens, Chrome will not load webpages (stuck on "Waiting for cache" message). The Terminal will take forever to perform simple commands, such as "ls". TextMate will freeze when trying to save a file, or sometimes even when trying to input data. Finder will lock up totally. At times during longer periods of freezing, there is a small burst of CPU cycles going through, so if I type "ls" in the Terminal, the command might execute after 40 seconds and then freeze again. I have searched the web high and low for a solution, but haven't even found anyone with the same issue. I have tried booting into safe mode, re-installing ML, uninstalling software, tampering with settings, isolating the behaviour to a certain app etc. I have found that the freezing occurs even after a clean reboot without starting any apps. There is nothing in the system logs. There is no extra network, cpu, memory or disk activity at the time. I have not found a single thing to pin this on. Using Photoshop, Parallels and Skype seem to make the freezing more frequent, but they are not solely responsible for it. Has anyone even seen this issue? At this point I have mostly given up on a solution, I am just looking for that "Who are you DenverCoder9? What did you see?" moment[1] Anyone? [1] http://xkcd.com/979/ http://xkcd.com/979/
- Cybernetic 14y agoI feel your pain, this happens to me too. I thought extra RAM would help, but it didn't. I thought a clean install would help, but it didn't. I hope "DenverCoder9" is out there. :)
- nixy 14y agoCybernetic, you are my DenverCoder9. Thank you.