Reverting file URL bug mishaps in Mountain Lion

If you are suffering from repercussions after testing the file URL bug in Mountain Lion, then there are several things you can do.

Before it was revealed, the file URL error in OS X was a fairly obscure and benign bug, and perhaps still is for the most part; however, since learning about it, a number of people have tried it out on their systems to have some fun, only to find that in some instances the bug may stick and perpetually crash a particular program.

While it is known that the offending string that triggers the bug will be saved in crash logs, which in turn can crash the Crash Reporter and Console applications, it may also be saved in a program's transcripts, settings, or other autosaved features. For instance, some have found that they can crash Safari by searching for the offending string in the Safari toolbar, but this does not get saved and when Safari is next opened the search bar is empty again and the program runs as expected. However, others have tried it in Apple's Messages program only to find that when they next open the program it reloads the saved message and subsequently crashes.

On a similar note, one rather nefarious test (or perhaps prank) that some are pulling is to send friends of theirs who use Messages in Mountain Lion a message containing the offending string, which results in the program crashing and then continuing to do so when relaunched.

If after playing around with the bug you find yourself in this situation, there are a few of things you can do.

  1. Locate and remove autosaved information
    Multi-file selection in the OS X Console
    By quickly invoking multifile selection in the Console you can avoid invoking the bug and remove the crash logs that contain the offending string. Screenshot by Topher Kessler/CNET
    If accessing the crash logs in the console are resulting in the crash, then you can quickly select and remove them from within the application. To do this, click one then quickly Shift-click another to invoke a multiple-selection, and then press Command-delete or right-click the selection to send them to the Trash.

    If this does not work, you can remove them manually from within the Finder. Hold the Option key and choose Library from the Go menu in the Finder, and then open the Logs/DiagnosticReports folder. Note the name of the logs in the console and then remove the corresponding ones from the DiagnosticReports folder.

    For Apple's Messages program, locate and remove chat databases that are in the "Messages" folder (as opposed to the Logs folder) in the same user library, and remove the files that begin with "chat.db" in their names. Then go to the Archives folder and remove the most recent saved chats (they are listed by date).

    Other programs may have similar data stores located in the user directory that you can likewise access and remove, but these specifics will depend on the programs themselves.
  2. Clear out the program's Resume states
    Saved Application States in OS X
    The saved application states for programs you use look like this, and contain all the resume information the program uses to restore windows upon launch. Screenshot by Topher Kessler/CNET
    A more global approach to addressing this problem is to clear out the OS X saved application state for a program if upon launching it continually tries to open a document that contains the offending text. To do this, again in the same user library folder open the "Saved Application State" directory and locate the folder in here that corresponds to the program that is crashing. The folder will be named after the program's domain scheme that includes its developer name, so for example, the one for TextEdit will be "com.apple.TextEdit.savedState."

    Remove the savedState folder from the "Saved Application State" directory and then relaunch the application and it should no longer open the problematic file on launch.
  3. Remove a program's preferences file
    If you tried to see if the text will crash the program by entering it in a text field within the program's preferences and now experience a crash whenever you open the preferences, then you can remove or edit the preferences file for the program to clear out the offending string. To do this, as with the program's Resume states locate the preference file by name within the Preferences folder. Then use a text editor like TextWrangler that is not affected by the bug to open the file, and then search for and remove instances of the string within it. Alternatively you can simply remove the entire preferences file and have the program re-create it from scratch. This will result in a number of default settings for the program, but should restore the program's settings so they don't cause it to crash.


Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    Join the discussion

    Conversation powered by Livefyre

    Show Comments Hide Comments
    Latest Galleries from CNET
    The best tech products of 2014
    Does this Wi-Fi-enabled doorbell Ring true? (pictures)
    Seven tips for securing your Facebook account
    The best 3D-printing projects of 2014 (pictures)
    15 crazy old phones from a Korean museum (pictures)
    10 gloriously geeky highlights from 2014 (pictures)