The Mysterious File:/// Bug

Recently, there has been a rather silent but important story floating around about an odd bug built into Cocoa (OS X’s application programming interface that, in part, includes the user interface elements of OS X including things like buttons and text boxes). Although not generating a lot of news, this is an interesting bug that’s worth exploring.

Triggering the Bug
The bug manifests itself simply by typing File:/// into any native Cocoa widget. Open up any application that uses Cocoa for its text boxes and enter that string. Press space and watch the application crash gloriously. Click here to see a short video of the bug in action.

You’ll notice that if you chose to report the bug, Crash Reporter itself crashes. Why? Simple – the text box that contains the bug report also contains the File:/// string and thus, Crash Reporter also crashes. It’s a vicious circle that you can’t avoid.

The Cause
For the few of you on OS X 10.6 or older, you’ll notice that this bug doesn’t affect you. This is because the bug is related to OS X’s spell checking functionality introduced with Lion. A more technical explanation can be found here. Word on the street suggests that a recent build of 10.8.3 fixes this.

But it Doesn’t Happen Everywhere!
You may notice (if you decided to explore this) that the bug doesn’t affect every application. This is because, despite the fact that many applications look native, many are in fact not. The easiest and perhaps most relatable example is the difference between Safari and Firefox. Safari uses native Cocoa interface elements to draw the UI. Consequently, Safari will crash gloriously. Firefox however does not crash because, although it may look like a native application, Firefox does not use Cocoa. Since Firefox is a cross platform application, it uses a cross platform UI toolkit which, as you can guess, is not Cocoa and therefore, Firefox is not susceptible to the bug.

Leave a Reply

Your email address will not be published. Required fields are marked *