Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Preview always crashes on launch

To being, yes, I've searched this forum and found other threads so-titled, but none of the advice I read there helped me; hence this new thread.


I am running OS 10.8.4 on a 2009 DuoCore iMac.


The problem began today when I tried to open a bad TIFF file in Preview that was stored on my Time Capsule. (No I didn't know the TIFF file was bad before I attempted opening it.) The bad file caused Preview to crash. I've since deleted the file but Preview continues to crash every time I launch it.


Yes, I've gone into /Library/Containers/ and deleted out that Preview folder. Deleting that does no good. That folder merely gets recreated when I launch Preview again, and Preview stupidly crashes again.


Here is what Console says when I try to launch Preview:


Sep 6 11:06:14 James-iMac com.apple.launchd.peruser.501[235] ([0x0-0x638638].com.apple.Preview[7122]): Job appears to have crashed: Illegal instruction: 4

Sep 6 11:06:14 James-iMac.local ReportCrash[7124]: Saved crash report for Preview[7122] version 6.0.1 (765.6) to /Users/james/Library/Logs/DiagnosticReports/Preview_2013-09-06-110614_James-iMa c.crash

Sep 6 11:06:15 James-iMac.local dirhelper[7112]: mkdir(/var/folders/0y): No such file or directory

Sep 6 11:06:16 --- last message repeated 2 times ---

Sep 6 11:06:16 James-iMac.local dirhelper[7112]: mkdir(/var/folders/zz): No such file or directory



And when I try to launch Preview, the relevant info in the crash report seems to be the following two lines:


Application Specific Information:

Bug in libxpc: Could not obtain valid temporary directory for sandboxed app.



My guess is this crash is perpetually happening because Preview is try to reopen files I tried to open before, thanks to that silly feature which was born in Lion. You would think Apple would have programmed Preview (or any other app) to be smart enough to figure out that if it tries to reopen a document that resulted in a crash previously, it should not try to open it again! But alas, there is no such intelligence in Preview.


Please help!


Thank you.

iMac, OS X Mountain Lion (10.8.4), March 2009 DuoCore, 8GB RAM, 1TB HD

Posted on Sep 5, 2013 7:19 PM

Reply
5 replies

Sep 5, 2013 8:35 PM in response to JDW1

Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.

This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.


Step 1

If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.

Triple-click the following line on this page to select it. Copy the selected text to the Clipboard (command-C):

{ sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null

Launch the Terminal application in any of the following ways:

☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)

☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.

☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.

Paste into the Terminal window (command-V). You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.


The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal. Reboot and test.

Step 2 (optional)


Take this step only if you have trouble with Step 1 or if it doesn't solve the problem.

Boot into Recovery. When the OS X Utilities screen appears, select

Utilities Terminal

from the menu bar. A Terminal window will open.

In the Terminal window, type this:

res


Press the tab key. The partial command you typed will automatically be completed to this:

resetpassword


Press return. A Reset Password window will open. You’re not going to reset a password.

Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.

Select your username from the menu labeled Select the user account if not already selected.

Under Reset Home Directory Permissions and ACLs, click the Reset button.

Select

Restart

from the menu bar.

Sep 5, 2013 9:39 PM in response to Linc Davis

Thank you for the detailed solution plan, Linc. I will try that when I have sufficient time to do a complete backup. Right now, I don't that time.


What I really wanted to know was if there are any simple tricks that would allow me to launch Preview and prevent it from trying to reopen files that it had opened before (such as that bad TIFF file). In other words, are there any keyboard keys I can press during the launching of Preview that will accomplish that?


Of course, the TIFF file no longer exists, so even if Preview tried to reopen it, it couldn't because the file is gone now. But I am just curious what will happen if I can figure out a way to prevent Preview from trying to access those files when it launches. If I can fix this without having to spend HOURS making a bootable clone of my 1TB HD (the only way I can feel confident I have a truly usable backup that's ready to use in case anything goes wrong), that's what I want to do. I make incremental backups with Time Machine, but I exclude apps and system files, and that backup isn't bootable.


Thanks,

James Wages

Sep 5, 2013 11:28 PM in response to JDW1

Great news! I didn't have to follow your advice, Linc! 🙂


Not that your advice is not excellent, but honestly, I didn't want to have to spend several hours waiting to make a bootable clone so I could fix the problem that way.


What I did was restart with CMD-R held down, and I did a Repair Disk (which found nothing wrong) and then a Repair Disk Permissions, which found a few things wrong (although nothing pertaining to Preview that I could see). I then rebooted. For good measure I held down the Shift key while launching Preview. Preview launched just fine. I then quit and launched without Shift held down. It's now working fine.


So for any who have the same problem as I, try my steps first. If that fails, prepare to make that multi-hour backup and follow Linc's excellent advice!

Preview always crashes on launch

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.