New iMac freezes when awakened from display sleep

We have a new (intel) iMac and it is set so that the computer and hard drive do not sleep but the display sleeps. I have found repeatedly (like 6 times in the last 48 hours) that the thing freezes when you wake it up from display sleep. So I can be compiling stuff, the computer is alive, and then I go to wake up the display, and it goes black with the spinning beach-ball of death.
The log files are unrevealing.
Any suggestions?


Hi Bill,
   I hate it when that happens. I can't think of an aspect of simply sleeping the display that could freeze the system. Unfortunately, we don't know the details of what goes on when displays sleep. One thing that usually runs at a rather low level is a screen saver. Do you have a screen saver set to run? Maybe it's something silly like the screen saver trying to come on after the display sleeps.
   Naturally you want to run Repair Permissions if you haven't.
   I suppose the machine is freezing if there's no opportunity to get anything useful in the logs. The other thing I can think of doing is to secure shell in before the display goes to sleep and collect information about what is happening before the freeze. You might want to open several connections depending on what information you want to collect. The obvious choice is to run top, ordered by %cpu. When the machine freezes, top will probably be frozen showing the processes running at the time. You probably also want to monitor network connections with lsof. In fact, most of the things lsof monitors can freeze a machine.
   One of the connections could run a packet sniffer. Providing the sniffer writes to file frequently, you should capture the last packets before the freeze. You can send the capture file to me if you want a second opinion. If you don't get anything useful by sniffing from that machine, you might see something in a capture from a machine in promiscuous mode on the same subnet.
   To what directories, if any, does this machine bind? What network drives does it mount? Network operations are a prime suspect. Try comparable activities with the network disconnected.
   Well, that's all I can think of at the moment. Let us know what you find out.
   Shift to the left,
   Shift to the right,
   Mask in, mask out,