UPDATE check out the video of this bug in action. As you can see from this latest happening, there's no 3rd party software running. It's all Apple, so I guess now's the time you'd expect them to do something about it. Really annoyed with how this has been handled so far, i'm fuming.
So this post takes a diversion from my usual apple loving fanboyisms with a much darker and frustrated tone. This problem has been happening to me for ages, since I got my first Macbook pro (RIP). Now with a replacement I was hoping to have escaped from the computer gremlins but they just followed me right to the new machine.
After a bit of digging around I found this thread on the apple discussion forum and there seems to be a lot of people experiencing this issue. So please, if you're having this problem make some noise, join in the discussion or leave a comment here.
What Happens?
So I'll be developing away at my computer not suspecting a thing switching back and forth from iTerm, Texmate and Firefox. Maybe I'll even be listening to some tunes then BAM I'll go to switch back and the wee Application Switcher Bezel will stay on the screen. I can move the mouse and see it on screen but nothing else in the interface is responding. Madness! I have left the computer in this state for at least 15 minutes but it never recovers, the only thing to do is try and break it out of stasis!
From reading all of the posts on the apple discussion forum about this, it appears almost all the people experiencing it are apple laptop users with an external display! So use of an external display seems to be a crucial ingredient.
UPDATE So this has happened quite a couple of times since then but I have recently been collating the errors and whenever I disconnect the external display it will spew a bunch of errors *(one for every open application) * like the following to system.log if you open /Applications/Utilities/Console.app you can check for yourself.
Aug 19 14:17:07 starscream /System/Library/CoreServices/Dock.app/Contents/ \
MacOS/Dock: removeDisplayMapping: _CGSUnmapFramebuffer returns -536870206
Aug 19 14:17:07 starscream /Applications/Safari.app/Contents/MacOS/Safari: \
removeDisplayMapping: _CGSUnmapFramebuffer returns -536870206
...
SSH To The Rescue!
So I try the old favourite key command cmd+option+esc, nothing. I'm still wiggling the mouse trying to click, iTunes is still playing. Luckily there's another computer close to hand so I can SSH into the macbook and everything seems grand, I can run anything I want from the command line, sometimes running the following command will bring the computer back to life! only very occasionally though.
sudo killalll -9 Dock
This works I think because the Dock controls the applications switching functionality, but what generally happens is the Dock process is zombified. If that happens then I can kill any OSX gui application and it will be zombified too. The only way to get out of this mess I have found (without the aid of SSH) is to force shutdown or hard reset the macbook by pressing the power key for several seconds (and if that doesn't work hold cmd+shift+option at the same time).
Thankfully with SSH we can do things a bit more safely, but not without losing data!! agh! I have lost countless hours to this really really annoying bug in OSX. Sorry back to the point of this paragraph, having logged into the macbook from another computer I can issue the following command and it will always bring the macbook back to life instantly back to the login screen and loosing ALL unsaved data in open applications. So with that information, don't be issuing this command willy-nilly.
sudo killall -9 WindowServer
UPDATE: So as I said this has been happening a lot so I've been keeping the logs. After issuing this command I get a bunch of errors like the following in my system.log not generally for every application but they differ.
Aug 19 14:27:53 starscream /System/Library/CoreServices/Dock.app/ \
Contents/MacOS/Dock: kCGErrorCannotComplete : CGSDeviceLock: \
Invalid device window
...
Aug 19 14:27:53 starscream /System/Library/CoreServices/Finder.app/ \
Contents/MacOS/Finder: kCGErrorInvalidConnection : \
CGSFlushWindowContentRegion: Invalid connection
Long Term Solution?
So far, I have been dismissed a number of times by Applecare Technical Support for having custom software installed on my macbook. Being a freelance developer, my machine is very important to me and if it crashes I lose time and money because of it, taking the time out to try and fix the computer is costly as it takes up at least the best part of a day to get everything migrated accross. So I have done all of the following at least once to try and fix this, but none have made an improvement;
- Reset PMU
- Reset PRAM
- Reset NVRAM
- Deleted /Users/username/Library/Caches and /Library/Caches
- Run the Apple Disk Utility Disk Repair and Repair Permissions
- Run the Apple Hardware Test tool - No Faults or Errors
I have also rebuilt the computer from scratch and updated to OSX 10.4.10 and it is still happening. Aghh! So unfortunately I don't see a fix for this in sight. On the thread I was talking about, several people report to being able to reproduce the issue from scratch and that Apple have been notified about it. So Apple, just stop pansying about, passing your customers off with lame excuses and blaming third party applications. Take responsibility for your own bugs and just f&*$ing fix it!
7 Responses to “Apple Macbook Pro Freezing when Switching Application with Command+Tab”
Sorry, comments are closed for this article.


August 23rd, 2007 at 04:18 PM
This has happened to me twice in the past week and yes...I have an external display hooked up to my MBP.
September 5th, 2007 at 02:21 AM
This has just happened on my 9 month old 15" MBP (Core 2 Duo). It's happened a few times, very annoying. The mouse cursor still moves, I can still SSH in, but killing apps does not seem to make them disappear from the screen. I'm going try LiteSwitch X (Cmd-Tab replacement) which has been suggested as a solution/workaround elsewhere...
September 17th, 2007 at 06:18 PM
Oh crap, me too! MacBook CD, happens occasionally, usually at wake-from-sleep.. :(
September 22nd, 2007 at 12:08 PM
I have the same problem with my macbook, from dec 2006 (I think it was)..
Here is a thread also, very active - and as of yet, no viable solution..
I really hope Leopard fixes this very annoying problem. Happened last on i macbook yesterday.
Regarding the external display .. I'm quite certain that it has happened without one plugged in to my macbook ... But when i think about it, it's alot more frequent when using an external display ....
September 22nd, 2007 at 12:12 PM
Oh totally forgot. Check out this thread http://www.joemaller.com/2006/09/19/os-x-gui-lockup-with-command-tab/#comment-18195 where there is a lot of activity as well, and a lot of people encountering this bug ...
The reply linked to is mine, that i wrote a while back.
September 28th, 2007 at 03:08 PM
Also have an external screen attached. Just very hard to reproduce, well it happens occasionally. When working I have been avoiding cmd-tab cause i don't want this to happen when i am in the middle of an edit. The error removeDisplayMapping: _CGSUnmapFramebuffer returns -536870206 shows up on both my MBP17 core duo and the MBP 15 core duo. Very annoying. Just been googling since today since I had some time to try figure out why. Use applecare next I guess.
October 3rd, 2007 at 03:02 PM
It's been 2 weeks since I bought liteswitchx and I haven't had even the slightest crash. Not to jump the gun a bit but I think this has totally fixed the issue.
The problem that they claim so undoubtedly is caused by third party applications has been fixed by a third party application. Ironic? yes, and I don't mean alanis morissette ironic.