Having trouble finding a solution to this online.

After two or three weeks of usage my iMac 27" (mid-2011) will freeze when attempting to switch users. Sometimes we get as far as entering a password, sometimes not.

There's no pattern as to which user is being switched from/to, and whether it's after waking from sheep or not. It'll just be stuck on the grey screen.

The OS will continue operating as normal in the background, I just can't interact with it. However the other day I noticed the mouse cursor was still moving in the background, and I managed to get back to the desktop and log out, but that was an exception.

I only recall this happening under Mavericks. Got the latest update and it's been a problem for the past several revisions. Have tried the usual repair permissions, SMC reset etc.

Any suggestions appreciated!