Wintellect Blogs

Fixing a Nasty Windows 7 + Mac Pro Sleep and Hibernation Problem

16 Nov , 2009  

As I’ve written before, Windows 7 and Mac Pros are made for each other. Except when the Mac Pro doesn’t want to wake up from sleep or restore from hibernation. That’s one scary problem and I thought I’d share my debugging notes on how I diagnosed the problem. As I am feeling generous on this Monday morning, I’ll even share the solution, too.

Everything was working great on my machine after I installed Windows 7 x64, but about a month ago, I’d occasionally have a problem where once the computer had gone to sleep it wouldn’t wake up. When I woke up the machine, the mouse would jerk across the screen and after unlocking the machine, it was nearly unusable. With Process Explorer running, I could see the machine suffering from a DPC storm (Deferred Procedure Call) where one of the four CPUs was stuck in kernel mode. In order to get the machine back, I’d have to force power off the machine.

The problem was very intermittent but I did occasionally see the a HAL error 12 in the Event Log:

The platform firmware has corrupted memory across the previous system power transition. Please check for updated firmware for your system.

Most of the reports of the problem were related to SATA drives on normal PCs and for Apple computers some were thinking it was related to NVIDIA graphics drivers. As I have an ATI card in the machine that definitely wasn’t the problem I was seeing. As it was so infrequent, I didn’t worry about the wake from sleep problem too much.

Until last week, that is. The week before I’d had two instances where it wouldn’t wake from sleep. What was weird about those was that after I held the power button down the restart the machine, the machine was showing the same hung signs when Windows started. It took a couple of reboots before I got the machine restarted correctly. At the beginning of last week, I had three instances where I got stuck in the multiple power recycles. I did notice that when restarting the machine from a stuck sleep state, that if Windows didn’t play the startup sound, the machine was suffering the DPC Storm and logging in was almost impossible.

By the end of the week, I had completely lost the ability to wake from sleep. If the machine did sleep, I’d have to do five or six power cycles and sometimes go into Safe Mode to get a working computer. Things were definitely not happy. I tried hibernating, but now when I restarted the machine it would hang restoring from hibernation. The weird thing is that in both cases, there were no errors at all in the event log related to any problem with waking up or anything else. As I had to get some work done once I got the machine started and working, I turned off sleeping until I had a chance to look at the problem.

My thinking was that this was feeling like hardware problems so to test that hypothesis I booted into OS X and tried all the same sleep options. Everything worked like perfectly and no matter how I tried sleeping the machine, it always woke right back up.

Now I was feeling that this was a software issue, but what could it be? I looked at all the installed software and the last driver I installed was when I installed Windows 7 on the machine. Since I could get the DPC storm at will now, I figured the only thing I could do was to hook up a kernel debugger and start debugging the shutdown and wake up. That was definitely not a prospect that I was looking forward to doing as that had “pain in the butt” written all over it.

Before I went down that black hole, I stepped back and said what do I know?

  • The machine works fine with OS X
  • The machine does not restore from sleep or hibernate from Windows 7
  • In the past I had seen the that scary HAL error 12 in the event log

That got me thinking about how Apple computers boot. They boot through EFI (Extensible Firmware Interface) where PC’s boot through the BIOS (Basic Input/Output System). Mac’s essentially emulate the BIOS so Boot Camp can load Windows. (Starting with Vista SP1 x64, Microsoft now supports booting from EFI.) My Mac Pro is a 1,1 model, which is the first Intel-based Mac Pro so I’m pretty sure the Windows boot mechanism goes through BIOS emulation unlike the later models.

A crazy idea popped in my head at this point. When I bought my first Macintosh a while ago, a Power PC MacBook Pro, and the fans never shut off when I first started it. I called Apple Support and the very sharp Apple support guy explained to me that many of the hardware settings are stored in a thing called “parameter RAM” (PRAM) and on rare occasions you have to reset it like a program. Looking at the Apple Knowledge base turned up an article on resetting both PRAM and the nonvolatile RAM (NVRAM) as well as explained what was stored in both.

The article didn’t say anything about the BIOS or Boot Camp settings, but resetting the PRAM/NVRAM is much easier than hooking up a kernel debugging so I give it a shot. Two Mac startup chimes later, I booted into OS X and verified that it was still working. Restarting into Windows 7, I heard its startup sound and after logging in, I manually put the computer to sleep. One key press and the log in prompt was right there. No jerky mouse problems or DPC storms at all.

I’ve been testing the machine all weekend and everything is running great. My guess is that the PRAM/NVRAM settings on my machine have been having issues for a while and the HAL error 12 was when they first started. As there’s more work going on with the BIOS emulation to boot into Windows, the corrupted data was causing more problems as time went by. I know next time I see a HAL error 12 it’s a PRAM/NVRAM reset for me.

It looks like others have been having the HAL error 12 reported on their Macs so if you’re seeing that you might want to give the PRAM/NVRAM reset a try before you experience the problems I did. I’m almost positive that I’ve never reset PRAM/NVRAM ever on this machine. Let me know if this helps you out.

  • Anonymous

    I was experiencing more or less the same problem as you described here, or well, I was suddenly unable to wake the computer from sleep in windows 7 like I was before, I didn’t get to the point where the cold shutdown restart didn’t work yet, but zapping the pram seems to have done the trick and I can now sleep my machine (and more importantly wake the machine) again. Thanks for the tip.

  • Anonymous

    I think I encounter the opposite of your problem:
    When I choose hibernate from the “log off” menu or when I set hibernate as the default behaviour for closing the lid or pressing the Power-button, my mac pro hibernates as expected, but after a while it awakes herself.
    Does anyone else have a mac pro which suffers from this kind of ‘insomnia’?

  • Anonymous

    Thanks – this fixed my problem. However after I had done it I did Windows and Office thought they were possibly illegal versions, and I had to revalidate/activate them.

  • Anonymous

    Interesting discovery.I have a similar problem – it relates to HAL error 12 – but the symptoms are slightly different.Occasionally, when the computer sleeps, it gives a bluescreen when I wake it. So I have to restart the computer. The strange thing is, it only seems to happen when it goes to sleep automatically after X amount of time. It may also happen when on the battery, but I am uncertain. Its a Macbook late 2008.Do you think the PRAM/NVRAM will fix this issue for me?Cheers.

  • jrobbins


    It certainly can’t hurt to give the PRAM/NVRAM a reset.

    – John Robbins

  • Anonymous

    Solved. Sleep to Hibernate is actually a feature, not a bug. The default is that sleep goes to hibernate after 320 min of sleep on a laptop. So I doubled the sleep time and she sleeps through the night. it’s in advanced setting power management.

  • Anonymous

    I have the same problem: Mac Pro 1.1, running Windows 7-64 under Bootcamp. When I wake from sleep in Windows it sometimes hangs with jerky mouse prompting restarts/chkdsks etc. BUT its not every time, seems random, perhaps one in three. Very annoying.

    I think its related to Network card driver based on System Event monitor. I have found that I by *** disabling the NIC adaptor *** just before I put the computer to sleep ensures that the hang-on-wake problem ** never ** occurs. Its annoying having to do it each time, but it does stop the problem.

    So – knowing that its NIC driver related, does anyone know how to fix the problem?

  • Anonymous

    one of the problems with this solution is that (many users if you google hal 12 sleep errors) can not start their PC, and looking after nvram pram is beyond the scope of everyday business/office users. The issue should be properly resolved by firmware upgrades by respective manufacturers.

  • Anonymous

    Am facing the same problem on MacBookPro 7,1 running OS X 10.7.2. Installed Windows 7 professional using BootCamp 4.0 couple of days back. And the windows won’t wake up when it sleeps and I have to power off and restart every time. Tried resetting PRAM/NVRAM, it works the first time (i.e. wakes from sleep) but as soon as I open an app(outlook/browser) and ‘sleep’ the machine, it won’t wake up. I have to restart the machine again and the usual ‘windows didn’t shutdown properly error’. Hope there is another workaround.

  • Anonymous

    Writing this 18 months later, the rpbolem is still not solved. Being a parent of a pre-teen and a new teen, paying the money to buy a new brick is a low priority. I think last time I looked second-hand ones were going for a348, but who is to say they’re not faulty too. Come on Apple. Please resolve this.

  • Anonymous

    Is unbelievable for how long this problem exist and Apple did nothing on it … I believe is Apples problem …
    Same problem – tried solutions explained here and nothing works … removed hibernate and hybrid hibernate and still after many hours, not sure how many … Windows 7 falls into a deep sleep and nothing wakes it up … so frustrating !!!

  • Anonymous

    My 2008 MBP was crashing with the BSOD from Standby mode in WindowsXP Pro. I updated the NVidia video drivers (debug logs later showed that was needed as well) but it was still crashing. I installed Microsoft’s debugging tools and it pointed squarely at the 1394 Firewire driver from Microsoft. I then read about numerous issues using Firewire on Macbooks (especially FW800) and in XP in general (apparently Microsoft’s drivers suck there period).
    Anyway, I found out Texas Instruments (who make the chips used) recommend the Unibrain ( drivers and so I downloaded their drivers (they also work in Vista and Windows7) and installed them and rebooted and glory be, Standby mode now works PERFECTLY and Firewire works correctly in XP now as well. If anyone is having similar problems and the video driver or whatever doesn’t fix it, you might give these drivers a try (especially under XP SP2 or SP3). They worked a miracle here. Windows is completely stable now here (for whatever that’s worth; I rarely use it except for gaming).