Hi everyone,
It's been sometime since I don't post on this thread, and we seam to have reached at more than 60 pages, which is quite impressive.
I was indeed having the problems listed in here (freeze at login) and also have system crashes when trying to resume from suspension (safe-sleep). All this at a MID-2010 MPB with nvidia GT330M and Core i5 2.4GHz.
Unhappy with the situation of such instability and unreliability of the system, I did a return to the official OS from the buy 10.6.3 and was happy with it with no problems at all.
But the bugs on 10.7 still bugged me, how could Apple release and keep such a problem with no response or comments what so ever. I than called Apple Line because I did payed for Lion and it should work.
At the call the advisor told me to make some tests.
First he advised me to plugin the ethernet cable, otherwise I wouldn't get the Lion tools available. With ethernet in place, I rebooted Snow Leopard holding 'D' key to enter Apple Hardware Test. I did such test to confirm that no hardware problem was persisting on my MPB (luckily no hardware problem was found, meaning it must be a software problem).
After confirming it is a problem with Lion, we did a Lion installation using a completely clean installation, but not from Snow Leopard + Lion upgrade, a complete installation from Lion itself. To do that the MPB needed to boot holding Command + 'R' key with the ethernet cable on. It than opened a globe with a progress bar and started to download Lion Recovery Disc. After a 40 minutes of download (around 2 GB), it entered the Lion Recovery Installation.
In there we started the Disc Utility and selected the Hard Drive, so we could completely erase the contents (be aware that I did a backup on an external HD before the whole procedure).
With a clean HD, we did a Lion installation from network (entering the apple store user and password to validate the purchase). It did a huge download - around 3.7 GB and than started installing.
At the end I had a completely clean OSX Lion 10.7.4. That did fixed my login Freeze problem.
Than I started checking if I would have a resume-from-suspension-crash. After 50 suspensions, it did a system crash which I needed to do a hard-reboot.
I started to dig around and saw somethings, first that it no longer crashed because of NVDA, even though that was still on the Console application at the time of the crash, but that was not the crash, because after that the system still connected to network normally and then it crashed.
After the hard-reboot a log of the system crash was presented, showing that the error was actually at NVRM (nvram). So I started looking to see how the safe-sleep works, it does a half suspension, half hibernation process: leaving backup of the suspension on the hard-drive so that if power goes off it will resume from hard-drive.
I analysed that the system would not return if the suspension holded for more than 70 minutes, at that time it seamed that the system would try to return but part of the information was not at the reach for the system.
One thing that changed from Snow Leopard to Lion was that Lion no longer allows you to turn off Secure Virtual Memory, this makes suspension secure so that no one can break your password while the informations holds on swap or ram.
But power management has some kinds of suspension style:
0 - good-old suspension method that only sits the information on RAM (faster but if you lose power during suspension you will lose your data as well)
1 - good-old hibernation method that make data on hard drive and shutdown completely (slower but will make your computer not lose any power at all since it will be completely shut)
3 - apple's safe-sleep which makes a simple suspension like 0 but set data on hard drive as a backup (defaul for laptops which is slower than 0 but faster than 1, but it is as safe as 1 if power is lost)
5 - same as 1 but considering the use of secure virtual memory. It is no longer mentioned at man page.
7 - same as 3 but considering the use of secure virtual memory. It is no longer mentioned at man page.
25 - same as 5 listed at man page as "hibernation"
There I realized some inconsistency. If Lion has secure virtual memory enabled by default, why was my hibernatemode set to 3 (safe-sleep without securve virtual memory - you can see your hibernatemode entering Terminal and typing "pmset -g"). This would only make sense if hibernatemode type 3 on Lion is now secure virtual memory always.
Since that seamed wrong to me I changed from 3 to 7. (you can change the hibernatemode using the command on terminal: "sudo pmset -a hibernatemode 7")
After changing to make sure that I wouldn't have problems with power management, I made a change from power preferences pane to disable the option to set harddrive to sleep when possible, and also disabled the graphics automatic switching.
Since than made lots of tests, suspended a lot of times, using many different ways, set the suspension at hold for 2 hours a lot of other times, to see the results and since than, no problems at all.
My problem got fixed using a clean Lion install of 10.7.4, and setting those options on power management, with pmset and power preferences pane. But still bugged by the pmset option, so can anyone tell me if hibernatemode type 3 on Lion is using secure virtual memory?