26

When I leave my Mavericks OS X MacBookPro idle for a while, very often it will crash and reboot by itself. After reboot, the Problem Report dialog will show up, telling that "Sleep Wake Failure experienced a problem". The problem report is not showing a crash — only powerstats from running programs. Here's the beginning of the report:

Date/Time:       2014-01-25 03:40:41 +0100
OS Version:      10.9.1 (Build 13B3116)
Architecture:    x86_64
Report Version:  18

Event:           Sleep Wake Failure
Steps:           50

Hardware model:  MacBookPro11,1
Active cpus:     4


Powerstats for:  [...]

This problem is described in various discussion forums, but I was unable to find it here. Simply googling for "sleep wakeup failure" (even without quotes) will turn up tons of relevant and unanswered threads; the same query here returns no relevant result. Those threads also include complete logs, hardware descriptions, and so on; I've excluded informations which seems unrelated (for instance, this seems to happen irrespective of the particular hardware).

https://discussions.apple.com/thread/5508018?start=0&tstart=0

I have a workaround and I will post it as a self-answer, but I would like something better — a statement that Apple is investigating would make me much happier.

Another relevant error message I got is, in the Console, "Restarting to collect Sleep wake debug logs" (which seems to come from IOKit within the kernel, see this source file). For the same crash as above, we see that the computer wakes up on an alarm after two hours without any logs, does little for 5-6 minutes (probably trying to wake up), and then after six minutes times out and reboots.

Jan 25 01:34:52 BlueVelvet kernel[0]: IOPPF: Sent gpu-internal-plimit-notification last value 0 (rounded time weighted average 0)
Jan 25 03:34:49 BlueVelvet kernel[0]: Wake reason: RTC (Alarm)
Jan 25 03:34:49 BlueVelvet kernel[0]: RTC: Maintenance 2014/1/25 02:34:49, sleep 2014/1/25 00:34:53
Jan 25 03:34:49 BlueVelvet kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000340
Jan 25 03:34:49 BlueVelvet kernel[0]: AppleCamIn::wakeEventHandlerThread
Jan 25 03:34:49 BlueVelvet kernel[0]: Previous Sleep Cause: 5
Jan 25 03:34:49 BlueVelvet kernel[0]: IOPPF: Sent gpu-internal-single-slice-plimit-notification last value 0 (rounded time weighted average 0)
Jan 25 03:34:49 BlueVelvet kernel[0]: IOPPF: Sent gpu-internal-plimit-notification last value 0 (rounded time weighted average 0)
Jan 25 03:34:49 BlueVelvet kernel[0]: AppleThunderboltNHI::prePCIWake - power up complete - took 60884 us
Jan 25 03:34:49 BlueVelvet kernel[0]: AppleThunderboltHAL::earlyWake - complete - took 1 milliseconds
Jan 25 03:34:49 BlueVelvet kernel[0]: TBT W (2): 0x0040 [x]
Jan 25 03:34:49 BlueVelvet kernel[0]: IOThunderboltSwitch<0xffffff8022d1fe00>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 11 unplug = 0
Jan 25 03:34:49 BlueVelvet kernel[0]: IOThunderboltSwitch<0xffffff8022d1fe00>(0x0)::listenerCallback - Thunderbolt HPD packet for route = 0x0 port = 12 unplug = 0
Jan 25 03:34:49 BlueVelvet kernel[0]: **** [IOBluetoothHostControllerUSBTransport][SuspendDevice] -- Resume -- suspendDeviceCallResult = 0x0000 (kIOReturnSuccess) -- 0x0c00 ****
Jan 25 03:34:49 BlueVelvet kernel[0]: ARPT: 58329.783703: si_survive_perst_war: bar0win before 18003000, bar0win after 18001000
Jan 25 03:34:49 BlueVelvet kernel[0]: AppleUSBMultitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitialized
Jan 25 03:34:49 BlueVelvet kernel[0]: ARPT: 58329.786957: pcicore_pci_pmeclr PMECSR : 0x4008
Jan 25 03:34:49 BlueVelvet kernel[0]: ARPT: 58329.786966: pcicore_pmestatclr PMECSR : 0x4008
Jan 25 03:34:49 BlueVelvet kernel[0]: ARPT: 58329.787066: pcicore_pci_pmeclr PMECSR : 0x4008
Jan 25 03:34:49 BlueVelvet.local hidd[193]: MultitouchHID: device bootloaded
Jan 25 03:34:49 BlueVelvet kernel[0]: en0: BSSID changed to 74:31:70:30:57:96
Jan 25 03:34:49 BlueVelvet.local airportd[209]: _doAutoJoin: Already associated to “EasyBox-305722”. Bailing on auto-join.
Jan 25 03:34:52 BlueVelvet.local Emacs-10.7[11343]: CGSCopyDisplayUUID: Invalid display 0x2b2826d2
Jan 25 03:34:54 --- last message repeated 2 times ---
Jan 25 03:34:54 BlueVelvet kernel[0]: AppleCamIn::handleWakeEvent_gated
Jan 25 03:35:27 BlueVelvet kernel[0]: **** [IOBluetoothHostControllerUSBTransport][SuspendDevice] -- Suspend -- suspendDeviceCallResult = 0x0000 (kIOReturnSuccess) -- 0x0c00 ****
Jan 25 03:36:21 BlueVelvet.local WindowServer[271]: _CGXHWCaptureWindowList: No capable active display found.
Jan 25 03:37:01 BlueVelvet.local WindowServer[271]: _CGXHWCaptureWindowList: No capable active display found.
Jan 25 03:37:31 --- last message repeated 1 time ---
Jan 25 03:39:49 BlueVelvet kernel[0]: Restarting to collect Sleep wake debug logs
Jan 25 03:39:49 BlueVelvet kernel[0]: AppleCamIn::systemWakeCall - messageType = 0xE0000310
Jan 25 03:40:03 BlueVelvet kernel[0]: **** [IOBluetoothHostControllerUSBTransport][SuspendDevice] -- Resume -- suspendDeviceCallResult = 0x0000 (kIOReturnSuccess) -- 0x0c00 ****
Jan 25 03:40:04 BlueVelvet kernel[0]: AppleUSBMultitouchDriver::message - kIOUSBMessagePortHasBeenReset.
Jan 25 03:40:05 --- last message repeated 1 time ---
Jan 25 03:40:05 BlueVelvet kernel[0]: AppleUSBMultitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitialized
Jan 25 03:40:05 BlueVelvet.local hidd[193]: MultitouchHID: device bootloaded
Jan 25 03:40:06 BlueVelvet kernel[0]: Sound assertion - Command/Response TIMED OUT and ( kRequestStateMatch == fCodecRequest->state = 2 ), fCodecRequest->command->codec: 0xffffff8023dc7f00, fCodecRequest->command->verb: 0x270503, fPoweredDown: 1
Jan 25 03:40:06 BlueVelvet kernel[0]: Sound assertion in AppleHDAController at line 5527
Jan 25 03:40:06 BlueVelvet kernel[0]: Sound assertion in IOHDACodecDevice at line 144
Jan 25 03:40:06 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget_10134208 at line 741
Jan 25 03:40:06 BlueVelvet kernel[0]: Sound assertion in AppleHDANode at line 343
Jan 25 03:40:06 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget at line 3414
Jan 25 03:40:06 BlueVelvet kernel[0]: Sound assertion in AppleHDAFunctionGroup at line 919
Jan 25 03:40:06 BlueVelvet.local Emacs-10.7[11343]: CGSCopyDisplayUUID: Invalid display 0x2b2826d2
Jan 25 03:40:07 --- last message repeated 2 times ---
Jan 25 03:40:07 BlueVelvet kernel[0]: Sound assertion - Command/Response TIMED OUT and ( kRequestStateMatch == fCodecRequest->state = 2 ), fCodecRequest->command->codec: 0xffffff8023dc7f00, fCodecRequest->command->verb: 0x370503, fPoweredDown: 1
Jan 25 03:40:07 BlueVelvet kernel[0]: Sound assertion in AppleHDAController at line 5527
Jan 25 03:40:07 BlueVelvet kernel[0]: Sound assertion in IOHDACodecDevice at line 144
Jan 25 03:40:07 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget_10134208 at line 741
Jan 25 03:40:07 BlueVelvet kernel[0]: Sound assertion in AppleHDANode at line 343
Jan 25 03:40:07 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget at line 3414
Jan 25 03:40:07 BlueVelvet kernel[0]: Sound assertion in AppleHDAFunctionGroup at line 919
Jan 25 03:40:07 BlueVelvet kernel[0]: Restart still waiting on AppleHDADriver
Jan 25 03:40:08 BlueVelvet kernel[0]: Sound assertion - Command/Response TIMED OUT and ( kRequestStateMatch == fCodecRequest->state = 2 ), fCodecRequest->command->codec: 0xffffff8023dc7f00, fCodecRequest->command->verb: 0x470503, fPoweredDown: 1
Jan 25 03:40:08 BlueVelvet kernel[0]: Sound assertion in AppleHDAController at line 5527
Jan 25 03:40:08 BlueVelvet kernel[0]: Sound assertion in IOHDACodecDevice at line 144
Jan 25 03:40:08 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget_10134208 at line 741
Jan 25 03:40:08 BlueVelvet kernel[0]: Sound assertion in AppleHDANode at line 343
Jan 25 03:40:08 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget at line 3414
Jan 25 03:40:08 BlueVelvet kernel[0]: Sound assertion in AppleHDAFunctionGroup at line 919
Jan 25 03:40:09 BlueVelvet kernel[0]: Sound assertion - Command/Response TIMED OUT and ( kRequestStateMatch == fCodecRequest->state = 2 ), fCodecRequest->command->codec: 0xffffff8023dc7f00, fCodecRequest->command->verb: 0x570503, fPoweredDown: 1
Jan 25 03:40:09 BlueVelvet kernel[0]: Sound assertion in AppleHDAController at line 5527
Jan 25 03:40:09 BlueVelvet kernel[0]: Sound assertion in IOHDACodecDevice at line 144
Jan 25 03:40:09 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget_10134208 at line 741
Jan 25 03:40:09 BlueVelvet kernel[0]: Sound assertion in AppleHDANode at line 343
Jan 25 03:40:09 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget at line 3414
Jan 25 03:40:09 BlueVelvet kernel[0]: Sound assertion in AppleHDAFunctionGroup at line 919
Jan 25 03:40:10 BlueVelvet kernel[0]: Sound assertion - Command/Response TIMED OUT and ( kRequestStateMatch == fCodecRequest->state = 2 ), fCodecRequest->command->codec: 0xffffff8023dc7f00, fCodecRequest->command->verb: 0x670503, fPoweredDown: 1
Jan 25 03:40:10 BlueVelvet kernel[0]: Sound assertion in AppleHDAController at line 5527
Jan 25 03:40:10 BlueVelvet kernel[0]: Sound assertion in IOHDACodecDevice at line 144
Jan 25 03:40:10 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget_10134208 at line 741
Jan 25 03:40:10 BlueVelvet kernel[0]: Sound assertion in AppleHDANode at line 343
Jan 25 03:40:10 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget at line 3414
Jan 25 03:40:10 BlueVelvet kernel[0]: Sound assertion in AppleHDAFunctionGroup at line 919
Jan 25 03:40:11 BlueVelvet kernel[0]: Sound assertion - Command/Response TIMED OUT and ( kRequestStateMatch == fCodecRequest->state = 2 ), fCodecRequest->command->codec: 0xffffff8023dc7f00, fCodecRequest->command->verb: 0x770503, fPoweredDown: 1
Jan 25 03:40:11 BlueVelvet kernel[0]: Sound assertion in AppleHDAController at line 5527
Jan 25 03:40:11 BlueVelvet kernel[0]: Sound assertion in IOHDACodecDevice at line 144
Jan 25 03:40:11 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget_10134208 at line 741
Jan 25 03:40:11 BlueVelvet kernel[0]: Sound assertion in AppleHDANode at line 343
Jan 25 03:40:11 BlueVelvet kernel[0]: Sound assertion in AppleHDAWidget at line 3414
Jan 25 03:40:11 BlueVelvet kernel[0]: Sound assertion in AppleHDAFunctionGroup at line 919
Jan 25 03:40:28 localhost bootlog[0]: BOOT_TIME 1390617628 0
[... rebooting logs, omitted]
Jan 25 03:40:41 BlueVelvet.local spindump[497]: Saved diag report for Sleep Wake Failure version ??? to /Library/Logs/DiagnosticReports/Sleep Wake Failure_2014-01-25-034041_BlueVelvet.diag
5
  • 1
    Apple would investigate this specific instance if you file a bug report detailing the findings. When I report similar, sometimes I even get a response that it's a hardware problem and to seek service if that's the cause instead of software. There's good detail here and you might get a response although there's never a guarantee any one bug ever gets a response as many do not in practice.
    – bmike
    Commented Jan 31, 2014 at 14:17
  • I've had very similar problems with my Mac Pro (trashcan style) when I leave a G-Drive attached to the thunderbolt port. Is there anything new on this issue? Commented Jul 17, 2014 at 14:21
  • I have no news unfortunately. However, your issue is more specific: in your case, it's a specific device to be at fault. So if you file a bug report (which I didn't yet), you'd have more chances of getting this fixed. Maybe you could talk to support of the G-Drive producers: but I guess it uses standard Thunderbolt drivers, not a driver written by this company, so I guess they can at most talk to Apple. (But FYI, yours should be a comment to the question, not an answer). Commented Jul 20, 2014 at 10:03
  • did you ever find a solution for this? Commented Feb 7, 2015 at 23:10
  • Nothing new — the problem doesn't show up currently, either because of the workarounds mentioned below that I keep using, or because Yosemite fixed it. Commented Feb 8, 2015 at 19:10

2 Answers 2

12

The problem seems to be that automatic wakeups from the sleep state fail, possibly because of driver-related problems*. My workaround is to simply disable automatic wakeups — and even automatic sleep. Since for me the problem only happens when leaving my computer plugged in and idle for a long time, I can disable automatic sleep only when the power adapter is connected, without reducing autonomy.

However, this will increase power consumption and reduce idle time — so you might

To apply this workaround:

  • go to System Preferences -> Energy Saver -> Power Adapter tab.
  • check the box "Prevent computer from sleeping automatically when the display is off"
  • uncheck the boxes "Wake for network access" and "Enable Power Nap while plugged into a power adapter" (I also have disabled Power Nap disabled when on battery, in the Battery tab, but I'm not sure this was required).

*Therefore, some users only reproduce the problem when certain peripherals are plugged in. But for one user it might be Bluetooth, for another one some USB hard disk, and so on — there's no easy to recognize pattern, which might mean the problem is due to whatever driver happens to have an apparently rather common driver bug.

Update: my laptop is a Retina MBP Late 2013, and I am not sure how much this generalizes to other laptop (see comments).

5
  • Hi, which MBP do you have? Mine is Mid 2010 and probably for this reason I don't have some of the options you mention. Here is how my power adapter tab looks like: imgur.com/GFrM2SZ Commented Apr 16, 2014 at 6:22
  • Yeah I've had a 13" Retinal MBP Late 2013 since they were released last year, and this just started happening to me about a week ago. It happens just about every morning after the computer has been asleep all night, but not during short sleep periods of a few minutes or an hour during the day. Commented Aug 11, 2014 at 13:42
  • 1
    I tried your suggested workaround yesterday, and today for the first time in about a week my computer didn't crash overnight. Thanks! Commented Aug 12, 2014 at 10:58
  • Gah - my computer crashed again this morning. Guess this isn't working afterall. :-( Although, looking at Console again at least the error message was different this time. Actually there doesnt' appear to be an error message exactly. Before it was com.apple.sleep.failure and now it's just a hibernate log, and then a boot log immediately after. Commented Aug 13, 2014 at 11:19
  • 2
    So this time I tried "restore defaults" on both energy tabs (battery and adapter) and I haven't had an issue for two days. Fingers crossed. Commented Aug 15, 2014 at 12:13
11

Check with pmset -g for the hibernatemode setting. On my mac mini it was on 3 which is not appropriate for desktops. By changing it to 0, the issue went away. Read the excellent man page for further reference and instructions.

sudo pmset -a hibernatemode  0
2
  • 2
    That's interesting, but it can lose data if there's a power loss. Meanwhile, you get an upvote at least for teaching me about pmset. Commented Jul 8, 2014 at 10:53
  • Have this problem with hibernatemode set to 0.
    – bauerMusic
    Commented Mar 20, 2018 at 10:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .