Don’t Type ‘File:///’ on Your Mac – It Will Crash Your Apps!

All software has bugs, but this is a weird one. If you try typing the phrase “File:///” (no quotes, the f must be capitalized) into almost any app while running Mountain Lion on your Mac, it will crash. I tried it in Chrome, the browser I use while posting articles, and it works. Just a hint for a happy life, make sure all your work is saved before you try this, OK?

TNW:

The discovery was made recently and a bug report was posted to Open Radar on Thursday. It only gained a lot of attention on Friday night though, thanks to a Hacker News submission.

First off, it’s worth noting that the bug only appears to be present in OS X Mountain Lion and is not reproducible in Lion or Snow Leopard. That’s not exactly good news given that this is the latest release of Apple’s operating system, which an increasing number of Mac users have switched to.

A comment on HackerNews from NelsonMinar even points out that the bug will even crash the Mac error reporter! He managed to copy the crash dump before IT crashed, and it can be seen on PasteBin.

The underlying reported error is as follows: “*** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘condition “wrong extraction: File:///”‘ terminate called throwing an exception abort() called”

The bug is inside Data Detectors, a feature that lets apps recognize dates, locations, and contact data, which makes it easy to save this information in your address book and calendar. HackerNews user 0×0 explains:

Looks like it triggers on anything starting with file:// (+/) case-insensitive, but then something later in the data extraction makes the incorrect assumption that the string should start with file:// (+/) lowercase, and throws an assert. It’s really quite bad that a bug inside the data detectors can bring down a whole app.

HackerNews user zbowling said that many apps crashed for him, but SublimeText did not. Commenters pointed out that this is because it doesn’t use NSTextFields, and so, doesn’t use Data Detectors. Only apps that have a NSTextField on Mountain Lion will crash.

The bug has been reported to Apple, and will likely be patched at some point. In the short-term, if you tried this out and your app is automatically crashing itself, and you just can’t stop yourself from typing the offending phrase, then do this: Go to System Preferences; Language & Text; Text, and then uncheck “Correct spelling automatically” as well as “Use symbol and text substitution.” This will keep the error from occurring.

Chris Hauk

Chris is a Senior Editor at Mactrast. He lives somewhere in the deep Southern part of America, and yes, he has to pump in both sunshine and the Internet.