Mac quitting application when put to sleep

I've had this problem for over a year.


Whenever I put my mac on sleep (by pressing the sleep button or closing the lid), it automatically tries to quit all applications possible in the order of recent use. For example, if I have applications A,B,C,D opened in that order, when I put my mac to sleep and open it later, it quits in the order of A-B-C-D. The action has already taken place by the time I open my mac, but I know that it's in that order, because I always have my internet browser on top, then some other programs like Pages behind, and whenever I wake up my mac, my browser has been closed and there's a popup asking if I would like to quit Pages without saving it.


It doesn't happen with any others' macs that I know of so I believe there is something wrong with my mac, and I don't seem to be able to figure the problem out by googling.


Would really appreciate if someone could help me out here.

MacBook Pro with Retina display

Posted on Dec 16, 2013 1:26 PM

Reply
17 replies

Dec 16, 2013 3:33 PM in response to SPark9625

Please read this whole message before doing anything.

This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.


Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.

Safe mode is much slower to boot and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.

The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.

Test while in safe mode. Same problem?


After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

Dec 17, 2013 12:36 AM in response to Linc Davis

What are aftermarket expansion cards? I googled it and it includes sound cards and graphic cards. But how do I take them out?


I haven't put any extra devices into my computer, so the computer itself is pretty much what I bought a year ago. Because you said "after"market, I assume that in my case I shouldn't take anything out?


So essentially, can I just try safe mode without taking anything out?

Dec 17, 2013 7:08 AM in response to SPark9625

Please read this whole message before doing anything.

This procedure is a diagnostic test. It changes nothing, and therefore will not, in itself, solve your problem.

Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The procedure will help identify which such modifications you've installed, as well as certain other aspects of the configuration that may have a bearing on the problem. Don’t be alarmed by the seeming complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac.


If possible, these steps should be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. If you can only boot in safe mode, you can still use this procedure, but not all of it will work. Be sure to mention that in your reply, if you haven't already done so.

Below are instructions to enter UNIX shell commands. The commands are safe and do nothing but produce human-readable output, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. I am not asking you to trust me. If you can't satisfy yourself that these instructions are safe, don't follow them.

The commands will line-wrap or scroll in your browser, but each one is really just a single long line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it.

Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. Step 1 should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply.

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.


When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign.


Step 1


Triple-click anywhere in the line of text below on this page to select it:

PB=/usr/libexec/PlistBuddy; PR () { [ "$o" ] && printf '\n%s:\n%s\n' "$1" "$o"; }; PF () { o=$($PB -c Print "$2" | awk -F'= ' \/$3'/{print $2}'); PR "$1"; }; { o=$(kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}'); PR "Loaded extrinsic kernel extensions"; o=$(launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)|\.[0-9]+$/{print $3}'); PR "Loaded extrinsic user agents"; o=$(launchctl getenv DYLD_INSERT_LIBRARIES); PR "Inserted libraries"; o=$(crontab -l); PR "User cron tasks"; o=$(cat /e*/lau*); PR "Global launchd configuration"; o=$(cat ~/.lau*); PR "Per-user launchd configuration"; PF "Global login items" /L*/P*/loginw* Path; PF "Per-user login items" L*/P*/com.apple.logini* Path; PF "Safari extensions" L*/Saf*/*/E*.plist Bundle | sed 's/\..*$//;s/-[1-9]$//'; o=$(find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \) | wc -l); [ "$o" == 0 ] || printf "\nRestricted user files: %s\n" $o; cd; o=$(find -L /S*/L*/E* {,/}L*/{Ad,Compon,Ex,In,Keyb,Mail/**,P*P,Qu,Scripti,Servi,Spo}* -type d -name Contents -prune | while read d; do $PB -c 'Print :CFBundleIdentifier' "$d/Info.plist" | egrep -qv "^com\.apple\.[^x]|Accusys|ArcMSR|ATTO|HDPro|HighPoint|driver\.stex|hp-fax|JMicron|microsoft\.MDI|print|SoftRAID" && echo ${d%/Contents}; done); PR "Extrinsic loadable bundles"; o=$(find /u*/{,*/}lib -type f -exec sh -c 'file -b "$1" | grep -qw shared && ! codesign -v "$1"' {} {} \; -print); PR "Unsigned shared libraries"; for d in {,/}L*/{La,Priv,Sta}* L*/Fonts; do o=$(ls -A "$d"); PR "$d"; done; } 2> /dev/null | pbcopy; echo $'\nStep 1 done'


Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.

The command may take up to a few minutes to run, depending on how many files you have and the speed of the computer. Wait for the line "Step 1 done" to appear below what you entered. The output of the command will be automatically copied to the Clipboard. If the command produced no output, the Clipboard will be empty. Paste into a reply to this message. No typing is involved in this step.

Step 2


Remember that you must be logged in as an administrator for this step. Do as in Step 1 with this line:

PR () { [ "$o" ] && printf '\n%s:\n%s\n' "$1" "$o"; }; { o=$(sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix\.cron)|org\.(amav|apac|calendarse|cups|dove|isc|ntp|post[fg]|x)/{print $3}'); PR "Loaded extrinsic daemons"; o=$(sudo defaults read com.apple.loginwindow LoginHook); PR "Login hook"; o=$(sudo crontab -l); PR "Root cron tasks"; o=$(syslog -k Sender kernel -k Message CReq 'GPU |hfs: Ru|I/O e|find tok|n Cause: -|NVDA\(|pagin|timed? ?o' | tail | awk '/:/{$4=""; print}'); PR "Log check"; } 2> /dev/null | pbcopy; echo $'\nStep 2 done'

This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.

You can then quit Terminal.

To prevent confusion, I'll repeat: When you type your password in the Terminal window, you won't see what you're typing.

Note: If you don’t have a login password, set one before taking Step 2. If that’s not possible, skip the step.

Important: If any personal information, such as your name or email address, appears in the output of these commands, anonymize it before posting. Usually that won't be necessary.

Remember, Steps 1 and 2 are all copy-and-paste — type only your password. Also remember to post the output.

Dec 17, 2013 8:22 AM in response to Linc Davis

From Step 1:


Loaded extrinsic user agents:

com.fiplab.MemoryCleanHelper

org.macosforge.xquartz.startx

com.wacom.pentablet

com.hp.messagecenter.launcher

com.bjango.istatmenusagent

com.adobe.CS5ServiceManager

com.spotify.webhelper

com.facebook.videochat.SPark9625.updater

com.adobe.ARM.202f4087f2bbde52e3ac2df389f53a4f123223c9cc56a8fd83a6f7ae


Global login items:

/Library/Application Support/Wacom/BambooCore.app


Restricted user files: 37


Extrinsic loadable bundles:

/System/Library/Extensions/Pen Tablet.kext

Library/Address Book Plug-Ins/SkypeABDialer.bundle

Library/Address Book Plug-Ins/SkypeABSMS.bundle

Library/Internet Plug-Ins/FacebookVideoCalling.bundle

Library/PreferencePanes/Jitouch.prefPane

/Library/Internet Plug-Ins/AdobeAAMDetect.plugin

/Library/Internet Plug-Ins/AdobeExManDetect.plugin

/Library/Internet Plug-Ins/AdobePDFViewer.plugin

/Library/Internet Plug-Ins/AdobePDFViewerNPAPI.plugin

/Library/Internet Plug-Ins/Flash Player.plugin

/Library/Internet Plug-Ins/GOMPlugin.bundle

/Library/Internet Plug-Ins/GOMTVDownloadPlugin.bundle

/Library/Internet Plug-Ins/SharePointBrowserPlugin.plugin

/Library/Internet Plug-Ins/SharePointWebKitPlugin.webplugin

/Library/Internet Plug-Ins/Silverlight.plugin

/Library/Internet Plug-Ins/WacomNetscape.plugin

/Library/Internet Plug-Ins/WacomTabletPlugin.plugin

/Library/PreferencePanes/Flash Player.prefPane

/Library/PreferencePanes/Growl.prefPane

/Library/PreferencePanes/PenTablet.prefPane


Unsigned shared libraries:

/usr/lib/libgcc_s.10.5.dylib


Library/LaunchAgents:

com.adobe.AAM.Updater-1.0.plist

com.adobe.ARM.202f4087f2bbde52e3ac2df389f53a4f123223c9cc56a8fd83a6f7ae.plist

com.facebook.videochat.[my name].plist

com.spotify.webhelper.plist


/Library/LaunchAgents:

com.adobe.AAM.Updater-1.0.plist

com.adobe.CS5ServiceManager.plist

com.bjango.istatmenusagent.plist

com.hp.messagecenter.launcher.plist

com.oracle.java.Java-Updater.plist

com.wacom.pentablet.plist

org.macosforge.xquartz.startx.plist


/Library/LaunchDaemons:

com.DesignScience.DSMTTool.plist

com.adobe.SwitchBoard.plist

com.adobe.fpsaud.plist

com.anchorfree.ajaxserver.plist

com.bjango.istatmenusdaemon.plist

com.microsoft.office.licensing.helper.plist

com.oracle.java.Helper-Tool.plist

org.macosforge.xquartz.privileged_startx.plist


/Library/PrivilegedHelperTools:

com.DesignScience.DSMTTool

com.microsoft.office.licensing.helper


Library/Fonts:

Champagne & Limousines Bold Italic.ttf

Champagne & Limousines Bold.ttf

Champagne & Limousines Italic.ttf

Champagne & Limousines.ttf

Korean_Calligraphy.ttf

Russian.ttf

cbcopperplate.ttf

encodings.dir

fonts.dir

fonts.list

fonts.scale



From Step 2





Loaded extrinsic daemons:

org.macosforge.xquartz.privileged_startx

com.microsoft.office.licensing.helper

com.DesignScience.DSMTTool

com.bjango.istatmenusdaemon

com.anchorfree.ajaxserver

com.adobe.SwitchBoard

com.adobe.fpsaud


Log check:

Dec 16 23:59:27 kernel[0] <Debug>: PM notification timeout (pid 6779, Spotify Helper E)

Dec 16 23:59:27 kernel[0] <Debug>: PM notification timeout (pid 7272, Spotify Helper)

Dec 17 00:56:40 kernel[0] <Debug>: PM notification timeout (pid 6709, Spotify)

Dec 17 00:56:40 kernel[0] <Debug>: PM notification timeout (pid 6716, Spotify Helper)

Dec 17 00:56:40 kernel[0] <Debug>: PM notification timeout (pid 6717, Spotify Helper)

Dec 17 00:56:40 kernel[0] <Debug>: PM notification timeout (pid 6718, Spotify Helper)

Dec 17 00:56:40 kernel[0] <Debug>: PM notification timeout (pid 6719, Spotify Helper)

Dec 17 00:56:40 kernel[0] <Debug>: PM notification timeout (pid 6778, Spotify Helper)

Dec 17 00:56:40 kernel[0] <Debug>: PM notification timeout (pid 6779, Spotify Helper E)

Dec 17 00:56:40 kernel[0] <Debug>: PM notification timeout (pid 7272, Spotify Helper)



I am familiar with most applications listed on here... and I believe this problem existed before most of them were installed. But anyways this is the result. Sorry for such a long post!

Dec 17, 2013 9:20 AM in response to SPark9625

Please read this whole message carefully, especially the warnings, before doing anything.

1. I can only guess which of the modifications you've made to your system is causing the problem. The changes suggested here should be considered provisional; they may not help, or they may remove functionality that you find useful. If a third-party system modification that you want to keep is at fault, refer to its developer for support.

2. WARNING: Back up all data now if you haven’t already done so. Before proceeding, you must be sure you can restore your system to its present state, even if it becomes unbootable. If you’re not sure you can do that, STOP — DON’T CHANGE ANYTHING.

If you don't like the results of the procedure suggested below, restore from your backup.

I will not be responsible for the consequences, and I will not be able to help, if you ignore this warning.

3. You should either remove or update the following system modification(s), if an update is available from the developer:

[Not applicable]

and definitely remove at least the following:

† MemoryClean

Hotspot Shield

4. Whatever you remove must be removed completely, and (unless otherwise specified in this message) the only way to do that is to use the uninstallation tool, if any, provided by the third-party developers, or to follow their instructions. If the software has been incompletely removed, you may have to re-download or even reinstall it in order to finish the job. I can't be more specific, because I don't install such things myself. Please do your own research.

Here are some general guidelines to get you started. Suppose you want to remove something called “BrickMyMac” (a hypothetical example.) First, consult the product's Help menu, if there is one, for instructions. Finding none there, look on the developer's website, say www.brickmymac.com. (That may not be the actual name of the site; if necessary, search the web for the product name.) If you don’t find anything on the website or in your search, contact the developer. While you're waiting for a response, download BrickMyMac.dmg and open it. There may be an application in there such as “Uninstall BrickMyMac.” If not, open “BrickMyMac.pkg” and look for an Uninstall button.

Again, please don't ask me to do this research for you. You can do it better than I can, because I don't use the product and I may not even know what it is.

You will generally have to reboot after uninstalling a system modification. Until you do that, the uninstallation may have no effect, or unpredictable effects.

5. If you can’t remove software in any other way, you’ll have to erase and install OS X. Never install any third-party software unless you're sure you know how to uninstall it; otherwise you may create problems that are very hard to solve.

WARNING: Trying to remove complex system modifications by hunting for files by name often will not work and may make the problem worse. The same goes for "utilities" such as "AppCleaner" and the like that purport to remove software.

6. I recommend that you never reinstall the modifications marked with a dagger (†) above, if any. If your problem is resolved after uninstalling all the above modifications and rebooting, but you still want to use some of those not marked with a dagger, you can experiment with putting them back, one at a time, testing carefully after each step. Keep in mind that system modifications may be incompatible with each other or with future OS X updates, so it may not be clear which one is at fault.

7. If you still have problems after making the suggested changes and rebooting, post again. Remember: if you don’t like the results of this procedure, you can undo it by restoring from the last backup you made before you started.

Dec 17, 2013 9:47 AM in response to Linc Davis

Thanks for your replies. I really appreciate it.


However, may I ask why those two applications must be uninstalled? Quite a lot of people that I know of use both Hotspot Shield and Memory Clean, but they never had any problem with them, and by problems I don't mean just quitting applications but really anything. I asked if this happens to a friend of mine who also uses both applications (Mac Air though, and I use Pro Retina, if that changes anything). Furthermore, I had this problem before I installed any of the two.


I will try and remove the applications and will let you know if it works or not, but I still would like to know why it might cause problems for one but not for some others.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Mac quitting application when put to sleep

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