Why is my MacBook screenlocking on unlocking?
October 1, 2013 3:29 AM   Subscribe

My newly obtained MacBook has a minor but annoying behaviour. I have it set up to lock when the display goes to sleep. But when I unlock it, it relocks again. What gives?

Tech specs: mid-2012 MacBook Pro (refurb), running Mountain Lion.

The exact symptoms are:

- MacBook is asleep, I wake it up and get the enter password screen. THEN
- EITHER The Mac stays busy for a minute or two so I can't enter the password and then goes back to sleep
- OR I enter the password, get to the desktop, start to do something and the Mac goes to sleep
- I wake up the Mac again, enter my password and all is fine

This does not happen every time but seems to happen only when it's running on battery, not the power cable. Looking for advice on another forum, someone else had exactly the same problem and had a suggestion it was to do with Fusion. I do have Fusion installed but have never used it on this machine. (I did use it on my previous laptop and ported everything to the current one via a Time Machine backup.)

Ideas?
posted by outlier to Technology (14 answers total) 4 users marked this as a favorite
 
I had a similar problem where my MacBook wouldn't stay asleep because it was being woken up by a Bluetooth device. I just changed a setting under System Prefs > Bluetooth > Advanced to disable "Allow Bluetooth devices to wake this computer". Just an idea...
posted by deathpanels at 4:35 AM on October 1, 2013


I have the same or a similar problem with the same hardware and software - I just got Mac recently and haven't figured it out yet.

When it wakes up from sleep (or hibernation or whatever), I sometimes get a login dialog that is positioned lower on the screen. After entering that login, I have to wait for a few moments and then get a second login screen which IIRC has my desktop background behind it.

This seems to happen generally when it has been asleep for a longer period of time (maybe 8 hours or more), and regardless of whether it is on battery. If it is down for just short periods I get the second screen immediately.

Maybe the automatic login setting discussed here would do it.
posted by exogenous at 6:27 AM on October 1, 2013


Don't know about Macs, but I've seen this kind of thing happen on PCs with dying clock (CMOS) batteries. PC goes to sleep, clock runs slow; you wake it up, the software clock re-syncs to network time and causes a time step, which gets interpreted as a period of inactivity long enough to make the screen saver/suspend-to-RAM stuff cut back in again.

The workaround, until you get a new battery, is simply to set the go-to-sleep time longer. This makes it less likely that a time step will be big enough to re-trigger it. You might want to see if that works on Macs as well.
posted by flabdablet at 11:13 AM on October 1, 2013


Thank you for posting this question! This happens to me too (mid-2013 new Macbook Air, running Mountain Lion) and I finally feel vindicated that I am not crazy when I try to describe this problem to my roommates!
posted by andrewesque at 12:11 PM on October 1, 2013


Response by poster: Thanks all. From following some of your suggestions & pointers, it seems like this problem is not uncommon, although there's no clear solution. I don't want to switch off the security and use auto-login (if I password protect my tablet, so I should do the safe with my laptop). Some reports have people replacing their laptops only to have the problem reoccur. So, I've lengthened the go-to-sleep period and will see if that does anything.
posted by outlier at 8:30 AM on October 2, 2013


I'd appreciate hearing about it as soon as that workaround fails, or in a week or so if it seems to be helping.
posted by flabdablet at 10:24 PM on October 2, 2013


Response by poster: Well, it's not exactly a scientific experiment but after I lengthened the go-to-sleep period the number of double-locks seem to have decreased. Not reduced to zero but still.

(I've been told there's no such thing as a CMOS battery on a Mac, but perhaps the model of the error is correct even if the underlying cause if different.)
posted by outlier at 1:09 AM on October 8, 2013


Any clues here? Again, I don't know much about Macs and less about Fusion, but it may be that Fusion has got some kind of clock-affecting daemon running even if you don't currently have any VM guests set up on it.
posted by flabdablet at 5:37 PM on October 9, 2013 [1 favorite]


More possibilities (found via search for mac clock drift)
posted by flabdablet at 5:48 PM on October 9, 2013 [1 favorite]


At least in my case, the clock settings seem fine. I tried resetting the SMC which seems like it has helped as far as I can test it by putting the computer to sleep and then waking it up (for me, the double login screens seemed linked to the computer sleeping after being left alone for hours).
posted by exogenous at 6:28 AM on October 10, 2013


Response by poster: Haven't found any Fusion processes running on my machine (another thread implicated something called "Insomnia", ditto). My clock appears to be running exactly on the network time. I changed the network time server and then changed it back as suggested in one of the clock drift articles but we'll see.

I suspect that the nature of the error does involve the clock somehow, as when I lengthened the time-to-sleep, the problem abated. Still, it hasn't gone away completely. A few people have reported that when they updated to 10.9 (the developers release has just come out), the problem disappeared. Again, we'll see.
posted by outlier at 8:28 AM on October 10, 2013


My clock appears to be running exactly on the network time.

If the cause is clock-related, the issue will be that the clock stops running exactly on network time (or perhaps even stops altogether*) while your computer is asleep, and when it wakes there's a race condition: if immediately after waking the system activity monitor manages to sample the clock before the post-sleep updater has fixed it, then a subsequent time sample will seem to have occurred a long time after the first, and the activity monitor will see a spurious idle period which, if long enough, will make it put the machine back to sleep.

You might be able to catch the time step happening, in the case where your machine gets to the desktop and then sleeps once you've started to do things, if you keep an eagle eye on the desktop clock as soon as you see the desktop. But even if you don't see one, that doesn't mean the system activity monitor didn't.

It's quite plausible that a seemingly unrelated change in 10.8 could have caused the race condition and that a new OS release would fix it. Race conditions are often difficult to test for and hard to debug.

*The resolution of the motherboard's inbuilt battery-powered hardware clock is usually 1 second, too coarse for many purposes, so operating systems generally maintain a software wall-time clock using interval timers and interrupts; this activity stops along with everything else when a computer sleeps.
posted by flabdablet at 5:16 PM on October 10, 2013 [1 favorite]


Well, the SMC reset didn't work after all: it's still the case that every time the computer has been asleep for several hours or longer, I have to log in twice.
posted by exogenous at 6:13 AM on October 12, 2013


To follow up here: updating to Mavericks didn't help my situation. However, yesterday I moved everything to an SSD and the problem no longer occurs. This seems to support the "fresh install" idea others have suggested.
posted by exogenous at 3:40 PM on December 5, 2013


« Older Have you found the ascii for an Info roundel?   |   Holiday recommendations for mixture of relaxation... Newer »
This thread is closed to new comments.