MacInTouch Amazon link...

sleep/wake problems

Channels
Apple, Troubleshooting
Hi all,

My 2015 MacBook Pro has been crashing while sleeping - not every time, but frequently enough applications crash, and sometimes the entire machine UI locks up. When this happens, I can still ssh in, look at running processes, and even use the "say" command to speak through the speakers, but nothing I do can make the UI reset / allow me to log back in as normal. Shutting down with "sudo shutdown -r now" doesn't work either, I'm forced to hold down the power button and reboot in this case.

Electron-framework apps like Slack and Trello seem to exacerbate this, as perhaps does Backblaze as well. I still can't say for 100% certain, but they don't seem to be completely to blame.

This person on Quora seems to report a similar issue, and says it turned out to be a hardware defect:

Has anyone experienced anything similar?
 


Hi all,
My 2015 MacBook Pro has been crashing while sleeping - not every time, but frequently enough applications crash, and sometimes the entire machine UI locks up. When this happens, I can still ssh in, look at running processes, and even use the "say" command to speak through the speakers, but nothing I do can make the UI reset / allow me to log back in as normal. Shutting down with "sudo shutdown -r now" doesn't work either, I'm forced to hold down the power button and reboot in this case.
I haven't encountered this particular problem, but what have you tried to do from the SSH prompt?

If you use the "top" command, do you see anything in particular hogging the CPU?

If you type "ps x" (to look at the list of processes owned by your account, for all sessions), do you see anything unusual?

If you try terminating processes with the "kill" command, do any of them let you recover? In particular, what happens if you kill the apps that are/were running on the desktop? If any of them unblock the system, which one? What about if you kill daemons like "launchd" or the "login" process for your session?

Clearly, it's not acceptable to be forced to kill processes in order to recover, but if it works, then you have some very valuable information that can be used to track down the root cause - either to something you can fix or for sending a bug report to Apple.

How long did you wait for "shutdown -r now" to complete before giving up? I've had a few cases where my own Mac (a Mini running ElCap) got into a funky state and where shutdown (from the menu-bar) took a very long time to complete. As in a minute or two for the desktop to go away and 5-10 minutes of the spinning pinwheel icon before it actually powered off. Clearly, some critical piece of code was deadlocked and the system had to wait for several operations to timeout before deciding to stop waiting and continue with the shutdown.
 


Hi there! Thanks for responding. New forum looking nice here.

I haven't encountered this particular problem, but what have you tried to do from the SSH prompt?

If you use the "top" command, do you see anything in particular hogging the CPU?

If you type "ps x" (to look at the list of processes owned by your account, for all sessions), do you see anything unusual?

If you try terminating processes with the "kill" command, do any of them let you recover? In particular, what happens if you kill the apps that are/were running on the desktop? If any of them unblock the system, which one? What about if you kill daemons like "launchd" or the "login" process for your session?
Background: I'm a programmer who does a mild amount of linux sysadmin. When I looked I did not see any particular programs or processes taking excess CPU. The fans were on - but the fans are usually on when I'm plugged into external display, which is most of the time.

I'm looking through my notes, because - aha, this one stood out to me. This is from "ps", I believe this stands for "Uninterruptable wait" and "sleeping". No amount of kill, kill -9, kill -HUP did anything (though I understand now that -HUP is just for programs written to expect to be hung up on on with modem disconnects?).

_windowserver 244 0.0 1.3 8894688 225564 ?? Us 19Dec17 378:01.97 /System/Library/PrivateFrameworks/SkyLight.framework/Resources/WindowServer -daemon

I believe there were other system processes which would just return with new process IDs after being killed. In any event, I haven't yet found a way to kill & reset something which resets the UI or allows it to go forward after I've gone past the login prompt.

How long did you wait for "shutdown -r now" to complete before giving up? I've had a few cases where my own Mac (a Mini running ElCap) got into a funky state and where shutdown (from the menu-bar) took a very long time to complete. As in a minute or two for the desktop to go away and 5-10 minutes of the spinning pinwheel icon before it actually powered off. Clearly, some critical piece of code was deadlocked and the system had to wait for several operations to timeout before deciding to stop waiting and continue with the shutdown.
How long - hmmm, hard to say. If I can reproduce this and have the leisure to let it just sit there, I'll measure.

Thank goodness for ssh (currently "blink" on the iPad Pro)! I wouldn't know even this much without that.

Other things I've tried, at the prompting of Apple support:
1. Uninstall backblaze backup. I periodically reinstall it to do full system backups to the cloud & then uninstall again.
2. Delete old applications.
3. Log in as a test user, although usually only for tests on weekends, not for an extended period. I've had the full crash when logged into another user before.
4. Installed MalwareBytes - nothing found.

Something else I've done, not at support's prompting, more of a sad commentary: installed Amphetamine, so that I can keep my mac from sleeping sometimes when I'm in the middle of something and yet will be away from the computer for a duration (or if I want to run backups all night).
 


In the past week or two, waking my fully updated 2017 iMac from sleep has caused some worrisome behavior. First, there's no response when using the trackpad or keyboard that came with the iMac. Second, waking with the power button takes a number of seconds and stops on the select-a-user before logging in screen. Then I log in and the full set of log-in applications begins.

There's no indication that it was shut down improperly, no invitation to send a report to Apple, just the exact behavior as if I restarted after a normal shut down. I've checked the System Preference panels and there's no indication about anything that seems related: In Energy Saver prevent sleeping when display is off is checked, but none of the others are: hard disks to not sleep, no wake for network, no start after power failure, no power nap. In Bluetooth, everything is checked: open setup assistant and wake this computer.

In Cocktail, the only thing I see is Disks->Sleep->Standby delay, which according to Cocktail help has to do with hibernation.

Any suggestions where I might look?
 


If you examine the system log you should be able to see if it's rebooting or just doing some sort of weird waking up.
 


I hate the new Console application. I checked it a couple of times after I started experiencing this problem, but I'm not sure which log to view or what to look for. It also seems that Apple has not fixed the problem of displaying no log content older than the moment the Console was opened!

Suggestions how to view the log for sleep/wake activity?
 



Since the update to macOS 10.13.6, I find that waking from sleep takes longer. Has anyone else had this experience?

2015 27-inch iMac, 1TB SSD, 16GB RAM.
 



Ric Ford

MacInTouch
Just saw this and thought it might be worth sharing:
Feather/Fledging support said:
Feather M13 NVMe SSD Upgrade...

There's a known hibernation issue with 2013-2014 MacBook Air and Pro. The best-known solution is to run "sudo pmset hibernatemode 0 standby 0" in Terminal. If you are using the Mojave OS you will also need to run "sudo pmset autopoweroff 0" after the first command.
 


A question about tracking down a failure to sleep: My wife's 2018 MacBook Air Retina with 16GB RAM and running macOS 10.14.6 is declining to fall asleep. It will sleep if closed or if commanded to sleep, but it no longer sleeps when it reaches the time set in Energy Saver, either on battery or on external power. This is the case even if no apps are open other than the Finder.

Activity Monitor doesn't show any processes in this state that are taking more than 1-2% of CPU (mostly <1%), so I don't think it's busy doing something. Malwarebytes says it's clean.

I'm thinking the next step would be to delete the preferences file for the Energy Saver pref pane, assuming it would be ~/Library/Preferences/com.apple.systempreferences.plist. Any other thoughts or suggestions, please?
 




I got a few panics during system sleep a few times in earlier versions of macOS 10.15, but since updating to 10.15.2, it's been once or more nightly, often just minutes after putting the system to sleep – iMac 18,3; boot device: 512Gbyte internal flash storage; two hard drives and one SSD (Samsung 860 EVO 1Tbyte) in an external, OWC Thunderbay enclosure.

The "power on hours" value is off by 18 from the value SMART Utility reports for the external SSD, so I'm wondering if it isn't the internal storage that's the issue. I also don't know whether "fBuiltIn = 0" conveys in formation of interest. (The hard drive power on times are much larger, since they're veteran devices from before I got this system in 2017.)

Anyone else seeing anything like this? Meanwhile, happy holidays, whichever one(s) you celebrate! (I guess I'm celebrating Festivus by airing this grievance.)
 


I got a few panics during system sleep a few times in earlier versions of macOS 10.15, but since updating to 10.15.2, it's been once or more nightly, often just minutes after putting the system to sleep – iMac 18,3; boot device: 512Gbyte internal flash storage; two hard drives and one SSD (Samsung 860 EVO 1Tbyte) in an external, OWC Thunderbay enclosure.

The "power on hours" value is off by 18 from the value SMART Utility reports for the external SSD, so I'm wondering if it isn't the internal storage that's the issue. I also don't know whether "fBuiltIn = 0" conveys in formation of interest. (The hard drive power on times are much larger, since they're veteran devices from before I got this system in 2017.)

Anyone else seeing anything like this? Meanwhile, happy holidays, whichever one(s) you celebrate! (I guess I'm celebrating Festivus by airing this grievance.)
Try turning off Power Nap in Energy Saver and unchecking Put Hard Disks to Sleep When Possible.

There’s some conflict that I have seen.
 


Try turning off Power Nap in Energy Saver and unchecking Put Hard Disks to Sleep When Possible. There’s some conflict that I have seen.
Yeah, there's definitely something going on with Catalina, Thunderbolt, and possibly the 2019 Mac Pro.

I have an external OWC dual SATA drive dock that connects via Thunderbolt 2; I used it with my 2013 Mac Pro to host external backup drives. Never had a problem.

When connected to my 2019 Mac Pro via Apple's Thunderbolt 3 <-> Thunderbolt 2 adapter, I get daily kernel panics; the error message is something along the lines of a timeout that occured in the BlockDeviceDriver or some such. My guess is the problems happened when a sleeping Mac tried to start a Time Machine backup. Not sure why a driver timeout would cause a kernel panic, but there you go.

Turning off Power Nap reduced, but did not eliminate, the problem.

So I switched to a USB 3 drive dock. The problem there is that anything connected to my Sonnet USB 3 PCIe card is rudely disconnected when the Mac sleeps. I'm told this is of little consequence, since drive caches are flushed before sleep, and the drives do reconnect automatically, but waking the machine up in the morning reveals dozens of error notifications, one for each time the drives were disconnected. Connecting the drive dock to one of the two USB ports on the Apple I/O Card fixed this problem.
 


... anything connected to my Sonnet USB 3 PCIe card is rudely disconnected when the Mac sleeps. ... Connecting the drive dock to one of the two USB ports on the Apple I/O Card fixed this problem.
Seriously? This problem is nearly 20 years old now, and Apple still can't figure our how to support third-party USB cards?

I had a similar (actually, worse) issue with my 2002 Power Mac - going to sleep while a storage device was attached to a third-party USB card would result in the computer never waking up (or possibly crashing on wake-up), forcing a restart in order to recover.

If Apple really can't figure out how to support third-party USB cards, maybe they can just take a device driver from FreeBSD and use that?

#applequality
 


Amazon disclaimer:
As an Amazon Associate I earn from qualifying purchases.

Latest posts