I had this weird problem after a log-out in a tight situation. What happened afterwards (and after rebooting) was that I only got a blue screen that flashed every minute or so. After a lot of tests and verbose booting, I noticed that the loginwindow.app was systematically crashing. What happened was that its prefs had a wrong user in the "previous user" field. The fix was:
- Boot in single-user mode (hold cmd-s while booting)
- Mount your disk as writable (it's explained in the last lines of the booting log).
- Open /Library/Preferences/loginwindow.plist in vi or pico
- In the part that says:
<key>lastUser</key>
<string>loggedOut</string>
change loggedOut to your user name (I'm not exactly sure that it's loggedOut, but it's something close to that, I didn't write it down).
- Save the changes and quit the editor.
- Type "shutdown -r now"
And voila, the cycling login window problem should now be gone!