A Simple Bug to Instantly Crash Apps on Mac OS X
Hey guys, this is Mac Heads 101, and today I'm going to be showing you a new bug in Mac OS 10 that was recently discovered.
Now, this bug makes it so that in most apps, if you type "file" with the capital "F," the app will pretty immediately crash. As you can see, TextEdit just crashed when I did that, pretty much right away. If you go to the report window, the report window may or may not crash pretty soon as well. But it shows you, before it does crash, that the problem actually is rooted in Apple's spellchecking code.
So, any application that uses the spell checking, even for instance Spotlight, if I do "file: SL" here, you can see my entire status bar up there crash and restart, because it uses the spell checking as well. Now luckily, an application called Terminal, which you probably have heard of if you watch my other videos, does not use spell checking. So if you type "file: SL SL SL" here, it doesn't actually crash.
To take advantage of this, I made a Terminal app called Spelling Crasher, which is just really simple. You just drag it into Terminal, hit enter, and then type a piece of text. Basically, what Spelling Crasher does is it just runs a piece of text through Apple's spell checker to see if it causes a crash.
So if I just type something normal like "this is a sentence," it says it worked out fine. However, if I type "file:///," oops, I need three slashes, it displays the crash log right in there because the Terminal app crashes and they can display the crash log, so you can see it.
As you can see here, this is just going to be interesting to the programmers who are watching this. Apple's actual problem has to do with the case sensitivity of some of their string comparison functions. The function that checks if something's a valid file link isn't case sensitive, but then inside that function, it makes sure that it's a valid URL, and in that case, it is case sensitive. Because of that, it can actually trigger a crash.
So, this is just a minor bug in a minor Apple API, and it affects all of the applications. I would actually consider it a major problem. For instance, you just can't possibly message someone on Messages; you can't send them "file:///SL SL slash" because Messages will crash. So it's actually a pretty big bug; it's annoying, and it's a problem.
Apple's going to fix it, but I just made this little Terminal app that you'll be able to download in the description to show you what's going on and what's crashing and all that stuff. Hopefully, you thought this was neat. Just maybe mess with your friends, tell them to type it in on their computer—who knows?
But anyway, thanks for watching, subscribe, and goodbye.