Typing These 8 Characters Will Crash Almost Any App On Your Mountain Lion Mac
An anonymous reader writes "All software has bugs, but this one is a particularly odd one. If you type "File:///" (no quotes) into almost any app on your Mac, it will crash. The discovery was made recently and a bug report was posted to Open Radar. 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 are switching to. ... A closer look shows the bug is inside Data Detectors, a feature that lets apps recognize dates, locations, and contact data, making it easy for you to save this information in your address book and calendar."
C-strings strike again.
You're doing it wrong.
no big deal.
Steve
BRB, heading down to the Apple Store...
const int one = 65536; (Silvermoon, Texture.cs)
SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
- An obscure library bug triggered by a magic string.
- In the latest version.
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
Tried this in every app I could think of and have had no issues (TextEdit, Komodo, iCal, Eclipse, Libra Office, Chrome, FireFox). Not calling shenanigans, but a specific example would be nice.
"Have you ever thought about just turning off the TV, sitting down with your kids, and hitting them?"
No one should ever need to type file:///
There are no bugs. You're doing it wrong
I tried it for myself with Google Chrome and Firefox and File:/// does crash the software. Very interesting!
THe only difference between a crash and an exploit is one has control when the app leaves the bounds of its ram addresses. Since MacOSX apps have access to file:/// in strings that can leave the control of the app then logic would dictate someone could do a file://sh grep -i .../etc/host cp malware.BAD .../etc/host or something stupid.
I do not own a mac so I do not know. Maybe another slashdoter who owns one who is more intuned with where critical files and services are can try to do execute something with it?
Either way this is not good at all and poor exception handling of some of the string apis.
http://saveie6.com/
I've tested it in several native apps, (Reminders, Textedit, Preview) and in Adobe Acrobat Pro 9.
Find a text input field, even in preferences and it crashes. Bizarre!
OSX 10.8.2
Build 12C3103
Talk about over-egging the pudding. You're talking as if it's a fundamental flaw that ruins the whole operating system. It's a bug. Of course it's not good news, but it's not certain doom for Mountain Lion either.
Bogtha Bogtha Bogtha
Landon Fuller has posted a gist on GitHub with an explanation of the bug and a binary patch to the affected library.
This sig is umop apisdn.
It kills Chrome if typed into the address bar and it kills Finder and iTunes if typed into the search. It is case sensitive - File:///
Running OS X 10.8.2 here, and I tried it in TextEdit, Mail, and Safari.. no crash.
"To make a mistake is only human; to persist in a mistake is idiotic." Cicero
> rarely would a Mac user have to type File:///
I admit, it is a bit odd to see it capitalized like that.
> (wait, I typed File:/// and it did not crash Firefox).
It probably has to be at the very beginning of a text-entry field.
(I'm just guessing, based on what "file:///" means. I can't test this one myself, as I don't have a Mac here, and the Mac I have access to at work is running Snow Leopard.)
Cut that out, or I will ship you to Norilsk in a box.
http://kleinschmidt.wordpress.com/2006/07/03/i-cannot-be-played-on-record-player-x/
Crashes textedit
XML is a known as a key material required to create SMD: Software of Mass Destruction
We have some text files from a Unix system named aux.something Trying to copy them or open them in Windows causes the whole system to grind to a halt.
----------------------------------- My Other Sig Is Hilarious -----------------------------------
Confirmed personally. OSX 10.8.2, 2011 mac mini. Entered the text into the search box in finder, crashed. It recovered fully in about 30 seconds though.
Good-bye
The bug is case sensitive; as the bug report says "The capital 'F' is important."
Please do not bother posting something so quickly, without looking into it.
This is the stack trace mentioned in the article:
http://pastebin.com/UkhERvaA
Doesn't look like a c-string or printf issue to me at all.
There's no -1 for "I don't get it."
Tried it, capitals and all, no crash
"Where is my mind?"
It's case sensitive.
null
correct, It crashed Chrome, Safari, itunes and text edit on my MBP w/ ML, but the F does have to be capitalized.
I wish I was a neutron bomb, for once I could go off...
I tried this in Safari on Lion. Capital F required, but indeed just "File:/// " crashes it.
Then you get a pop-up asking if you want to report the problem to Apple? Sure.
But then that crashes with a pop-up reporting that crash reporter has crashed. Bonus!
"Education is not the filling of a pail, but the lighting of a fire." -- William Butler Yeats
You used to be able to BSOD a Windows 95 or 98 machine by trying to read C:\con\con, and this included any web pages that requested file://C:/con/con.
No one should ever need to type file:///
There are no bugs. You're doing it wrong
Yes, they are doing it wrong, by typing file:/// in lowercase, or not typing it at all. So the obvious question is: "how can I type it right for them?" If I include "File:///" in an email I send to a Mountain Lion user, will it crash his Mail.app? Or if someone quotes it in a reply here?
That could become a cool little meme.
I searched in the Finder (iMac running 10.8.2) and got nothing strange. I tried Chrome, Firefox, Safari, Mail, a few text editors ... nothing. Sorry.
didn't some thing like @sony crash mac os 6?
If this is an assert as it appears to be, my question is, why is it in shipping code. Normally asserts are controlled by the NDEBUG symbol (or equivalent) which is undefined in optimized builds. In my opinion asserts should not be in shipping code. You should have something more solid in place.
Crashes Safari (address bar)
XML is a known as a key material required to create SMD: Software of Mass Destruction
Technically, any capitalization other than 'file:///' will do it. File, fILE, or FILE all have the same effect. The problem is the code compares the string to 'file://' without converting to lower case first...oops.
How can I believe you when you tell me what I don't want to hear?
It's encouraging that such a minor obscure bug makes a supposedly newsworthy article. That's progress. Back in the day almost anything could crash a Mac (or any other PC), including just leaving it on for a sufficiently long period, so the fact that a crash of this type makes news today shows how much progress we've made.
Technically, any capitalization other than 'file:///' will do it. File, fILE, or FILE all have the same effect. The problem is the code compares the string to 'file://' without converting to lower case first...oops.
Some code has figured out that the user entered a file url. A sanity check (badly programmed) figures out (wrongly) that it is _not_ a file URL. That wouldn't be a problem; I would have coded it so that something that looks like a file url but doesn't pass sanity checks is just not a file url. The problem is that this code throws an exception that isn't caught.
A note to C++ programmers: Convention in Objective-C is that exceptions are thrown to indicate programming errors. Exceptions are not handled by catching them, but by fixing the code that causes the exception to be thrown. So this sanity check shouldn't have thrown an exception.
> rarely would a Mac user have to type File:///
More people probably did this within the last hour than in the total history of MacOS X before :-)
Not really joking. If many people had done this, then the problem would have been found a lot earlier.
Ok, I didn't believe this, I thought it might be a hoax so I wanted to try this and typed it into a file in the TextEdit.app, and it crashed the TextEdit.app completely!!!!! I had a 10 page paper that I was writing in there opened and it hadn't failed yet. The paper is due tomorrow!! is there a way to sue apple for damages over this?!!?!!!!??
Just does nothing at all when clicked on, but that's not really a surprise since data detectors are not involved at that point. It's just rendering HTML so there's nothing to detect, the spec already says what it is and what it does.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Well, so much for the quality of Apple software compared to Microsoft. MSOffice 2011 handles this string perfectly. Every piece of Apple software goes down in flames. Word makes it into a link, Excel and Power Point treat it as text, I didn't pay for Outlook so I don't know about it handles this string.
Giving money to Apple.
If you're like me and send feedback to Apple when things go sideways, you can't on this. The Crash brings down the error reporting function "Problem Reporter". As soon as you click into the text field to describe the error it crashes too. Please note from my log:
2/2/13 8:43:18.001 PM Problem Reporter[517]: assertion on /SourceCache/DataDetectorsCore/DataDetectorsCore-269.1/Sources/PushDown/DDResultExtraction.c:1576 "CFStringHasPrefix(urlVal, CFSTR("file://"))" failed :wrong extraction: File:///
2/2/13 8:43:18.001 PM Problem Reporter[517]: wrong extraction: File:///
2/2/13 8:43:18.001 PM Problem Reporter[517]: An uncaught exception was raised
2/2/13 8:43:18.002 PM Problem Reporter[517]: condition "wrong extraction: File:///"
2/2/13 8:43:18.003 PM Problem Reporter[517]: (
I love the last line, is that open parenthesis supposed to be there all alone like that? This is a horrendous bug.
I noted that MSOffice seems to be immune. MS still uses Carbon instead of Coca as their framework. Is this a case of the old ways are still the best ways? Or is this an other case of Apple needs to improve their Quality Assurance.
Adam Engst of Tidbits has an article up on the Tidbits site on a Pages 4.3 bug that nearly prevented him from publishing his Take Control ebook on iTunes 11.
You were typing file:/// instead of File:///
Why can't Apple stop using these hokey names for their software versions after release? There is no means of knowing what version it is, and it requires out-of-band knowledge of the most useless type. "About this Mac" quotes the grown-up version number. The names are 100% pure loss
tone
This is apple we are talking about. Somehow this is a feature...
Since I haven't upgraded thanks to Apple's removal of scroll arrows, I can still type "File:///" on my Mac all I want. However, I can't imagine why I would want to.
It would be funnier if merely RENDERING "File:///" would crash the Mac.
After trying this in every app I could think of, and failing to crash them, it turns out that this is case sensitive.
Some dude has done a more detailed analysis over on github but the long and short of it is that there is a specific check in the code for 'file://' and any other case will cause it to crash. All caps - crash. Capital F and the rest in lower-case - crash. All lower-case and a capital L - crash.
Specialist Mac support for creative pros, Melbourne
Aquamacs does not seem to understand what the slave process know as "OSX" is on about in this case.
Probably not important.
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
You are holding it right. The others aren't.
It appears that this has something to do with URL validation for automatic hyperlinking in text fields. I am assuming that it does some sort of procedure that causes File:///[no carrier]
Sig: I stole this sig.
Every single application I have open didn't crash.
Excel
Pages
Chrome
FireFox
Safari
Terminal
iTunes
Omnigraffle Pro
Activity Monitor
Keychain
Preview
"Doctor, it hurts when I do this... Can you help me?"
"Sure, don't to that."
I'm going to give some free advice to users of Apple's OSX Mountain Lion: Don't do that.
You are welcome on my lawn.
Do you live in the real world or in some made up fantasy world?
Lets assume that their stock price does magically fall to $50. They have $150 billion in the bank. How many fucking buildings do you think US$150 billion can build?
I had the same problem, but apparently it relies on spell check being enabled (and case sensitivity, as so many keep pointing out). Turn off the spellchecker and there's no problem.
Also, learn to spell, in case it's not fixed quickly :)
When confronted with one problem, some think "I'll use recursion". Now they are confronted with one problem.
It's a commented assembly listing with a proposed hacky fix in assembly.
It's kind of fantastic, actually. Someone sends you an email saying, "let's meet for lunch tomorrow", or "my new phone number is ...", etc., and these become clickable to enter a calendar appointment, or address book entry, etc.
These trace back to the Newton, and were a huge part of that device's "magic". And when you get an email with a UPS tracking number as plain text (instead of a hyperlink), and it becomes clickable and asks if you want to track your shipment, you get one of those, "oh, now that's cool!" moments.
Google does something similar in search results. If you put in a UPS tracking number, the top result is for you to track the shipment, etc.
You did realize that a link does NOTHING because it's a bug in auto-detect code, right? I mean a link you post doesn't need to be detected, because it's a link... so clicking on your link on a Mac does NOTHING WHATSOEVER.
What a doofus.
Now, to use some JavaScript or HTTP Redirects to auto-load that URL, and have some REAL fun.
Which would have the same effect... I'm not sure why you get your jollies out of posting links that are inoperable, you may as well be posting text marked-up to have underlines.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
My fix is much simpler, to never type in a string I have never typed before for any reason anyway.
I mean, honestly - who capitalizes a URL scheme anyway? A C# developer? Madness.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
It just works...
I thought everyone knew File:/// is the new Command-Q
I wonder if automatic quoting of a message on an online message board could cause a crash of the web browser ...
Many message boards, although not Slashdot, has quoting of the previous message enabled by default when you click the [Reply] button. That would copy the previous post into a text field, which would trigger the bug, apparently.
Then all a MacOS/Mountain Lion user would have to do to crash his web browser on those message boards would be to hit the Reply button to the wrong post.
I expect File:/// trolling to explode on message boards in the next few days ...
"We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
It turns out that some programs (e.g. Unison, a usenet reader) will crash if they try to display a document containing the string. Quite possibly more will turn up - they'll be programs that try to recognise URLs and display them as a link.
Everyone's making fun of this, but this really is appalling. Apple has had nothing but trouble since Steve Jobs died. Just as people predicted. It shows that modern OS's are so bloated that it is impossible to remove all bugs. OS X and Windows 8 probably contain other similar bugs, but we just haven't found them. I would like to believe that bug-free code is possible. Perhaps Apple need to change their programming paradigms. If you want true security you need to greatly minimize your operating system and compartmentalise its tasks, so that it can be exhaustively bug-checked. Adding "features" to an operating system simply creates new security holes. We laugh at the Space Shuttle for running on 386's, and there's a bank here that still runs its terminals on OS/2, but there are applications for which code reliability is absolutely paramount. Think of space probes, nuclear weapons, pacemakers... Richard
It's an odd bug, but how many people are really going to be using this command on a Mac? Let's rephrase that: how many people actually know of this command, Windows or Mac users? I have probably used this command maybe a half dozen times in probably 10 years, and that is because Explorer or something has hard locked on me, and killing and restarting the process doesn't work, and I need to save or copy or move something before I reboot.
Now I will grant that I know many more geeks and nerds on Macs now than even 5 years ago, so I am not going to make the joke that "no Mac user would use this". I am just wondering how many people this really effects, and even those users who know about the command, how many would know that it was broken if not for this article.
I tested this on my Mac running Mountain Lion. I tested with Safari, BBEdit, and Mathematica. NO CRASH. something else is going on here.
Apparently this is a fault with autocorrect, which is enabled-system wide. If you disable it the bug doesn't work anymore.
Does it make you happy you're so strange?
It not only crashed Safari, but also crashed the bug report when I typed what I did to cause the crash!
This is fun!
Just a dude. Stuck in IT.
I find it hard to believe such an error exists, but I tested it on my MacBook Pro by typing it into Safari "File->OpenLocation" and sure enough it a bended Safari just like that. I said, "Dad, it hurts when I do this...", he said, "Don't do that". Given that this is now a known and discussed , it is very surprising that it has not been fixed right away by a software update. It does not take admin privileges to try to open a file by that name. Now all it seems to do is crash a single App, like Safari, but what if this was fed to a system process such that it cripples the OS if it crashes?
Don't go like that then.
(1.21 gigawatts) / (88 miles per hour) = 30 757 874 newtons