Announcement: Upgrade to macOS Mojave

With features like Dark Mode, Stacks, and four new built-in apps, macOS Mojave helps you get more out of every click. 
Find out how to upgrade to macOS Mojave > https://support.apple.com/macos/mojave

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

Question:

Question: Preview app crash and PID weirdness

System Info:

MacBook Pro (Retina, 13-inch, Early 2015)

Processor: 2.7 GHz Intel Core i5

Memory: 8 GB 1867 MHz DDR3

macOS: Sierra (10.12.6)


This started because the PreviewApp would randomly hang. It just becomes unresponsive. I try to force quit it, but that is ineffective. I use the Activity Monitor to try and locate Preview process, but it is not in the list. It also does not appear when I ps, pgrep, or top from the terminal. The problem is rare, but when it happens I have no recourse but to ungracefully shut down my mac and force a reboot. A graceful reboot is not possible because Preview can't be stopped by the OS either.


I was wondering if the process might still be alive, but orphaned in some way and not accessible to the process monitor. I thought if I knew the PID then maybe I could kill it from the command line. So I made this AppleScript that I run in the background and it periodically checks for the Preview PID. I made it so that it reports the Preview PID in the notifications any time the PID changes.


I was expecting the PID to only change when I quit Preview and then restarted it later. What I find instead is that Preview changes PID quite often, without quitting and restarting the app.


Q: Is this normal for Preview or Mac apps, in general?


I use linux on a daily basis and I have never seen this kind of behavior in linux.


Incidentally, in case you are wondering, yes I'm sure I'm capturing the Preview PID and not the grep PID.


Also, when Preview hangs and I do have the last recorded PID, trying to kill it results in a "No such process" error.


So, I'm starting to suspect that the hanging and the process changes might be related.


Any guidance?

MacBook Pro with Retina display, macOS Sierra (10.12.6)

Posted on

Reply

Page content loaded

Nov 14, 2017 7:27 PM in response to JoeyBlades In response to JoeyBlades

Do a backup, preferable 2 backups on 2 separate drives.


Quit Preview.


Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J. When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder. Remove the following. You may not find them all. Restart and test.

Containers/com.apple.Preview


Containers/com.apple.quicklook.ui.helper


Preferences/com.apple.Preview.LSSharedFileList.plist

Preferences/com.apple.Preview.SandboxedPersistentURLs.LSSharedFileList.plist


Saved Application State/com.apple.Preview.savedState


Credit Linc Davis for this solution.


Preview Reset automatic download - 3rd party solution

Nov 14, 2017 7:27 PM

Reply Helpful
User profile for user: JoeyBlades

Question: Preview app crash and PID weirdness