After the release of the latest update to the Macintosh operating system (10.5.3), some users were reporting a “login loop” to MacFixIt.com. I followed the always helpful advice on MacFixIt for updating the operating system, and after the first reboot everything came back fine on my PowerBook G4 I thought I was in the clear. With the second reboot, though, I started seeing the login loop: the machine boots fine, but when you put the username and password in, the system hangs for about 20 seconds before displaying the login window again. Clearly something is hosed, and fortunately I was able to fix it.
I tried the suggested solutions — booting in safe mode and logging in (still had the same problem); running a file system check in single user mode (no errors reported); deleting the login window plists; and changing the password — but they had no effect. I could log into the temporary admin account I give to Apple when the machine is sent in for service, so I knew it was something specific to my day-to-day account. I was able to get into single user mode (hold down Command-S right after the startup twang) and examine the /var/log/system.log file. This is part of the underlying UNIX nature of MacOSX, and was the only place I found that gave clues to what was going on. Here is a portion of the log file that occurs right after hitting return at the login screen:
loginwindow[23]: USER_PROCESS: 23 console
com.apple.launchd[1] (com.apple.UserEventAgent-LoginWindow[86]): Exited: Terminated
ReportCrash[106]: Formulating crash report for process lsregister[104]
ReportCrash[106]: Saved crashreport to /Library/Logs/CrashReporter/lsregister_timestamp.crash using uid: 0 gid: 0, euid: 0 egid: 0
kernel[0]: SetCryptoKey R: len 32, idx 1
ReportCrash[111]: Formulating crash report for process ReportCrash[105]
ReportCrash[111]: Saved crashreport to /Users/userid/Library/Logs/CrashReporter/ReportCrash_timestamp.crash using uid: uid gid: gid, euid: uid egid: gid
com.apple.launchd[92] (com.apple.ReportCrash[105]): Exited abnormally: Bus error
ReportCrash[112]: Too many crashes in rapid succession! No crash report being written for pid 113
com.apple.launchd[1] (com.apple.UserNotificationCenter[113]): Exited abnormally: Segmentation fault
com.apple.launchd[1] (com.apple.UserNotificationCenter): Throttling respawn: Will start in 10 seconds
ReportCrash[112]: Too many crashes in rapid succession! No crash report being written for pid 114
The key clue is bolded — the lsregister process is crashing. I found a clue to the fix in a 2003 blog posting by a guy named Rick when he said After a couple hours of snooping, and some luck (I was able to ssh in from another machine and watch the system log report the crashes), I discovered that Launch Services’ cache was corrupted, and was causing lsregister to seg fault.
His posting was related to MacOSX 10.2.6, and since then the name of the Launch Services cache file has morphed. I found it in the same place (the /Library/Caches directory), but now there is more than one and they take the form of “com.apple.LaunchServices-023uid.csstore” where uid varies depending on the appropriate userid number. I removed all of the Launch Services files from /Library/Caches, restarted, and was able to log in fine. The only side effect was that the applications-to-launch-at-login list was gone (the “Login Items” tab of the Account Preference Pane) and had to be reconstructed.
So I’m productive again, and I didn’t have to reinstall the operating system or transfer all my old files and settings to a newly-generated account. I hope this message helps someone else, too.
(This post was updated on 02-Sep-2008.)





22 Comments
beautiful, works like a charm. better than archive&install as recommended by apple
thanks guys
Great little fix. For me the solutions offered by Apple failed on my Mac Mini with wireless keyboard and mouse, unable to login using single user shift key and cmd + S. In the end used the install disk, needed a clean first, then ran terminal and did as you said. For me login items remained the same but a directory I had in the dock lost the hide file extensions that I had set up.
how do you fix it i dont understand >. <” I’m new to mac
macgirl –
I was intentionally somewhat vague in the solution because implementing the solution requires a bit of Unix experience. To write a new-user tutorial for this fix would be beyond my available time and possibly available skill. You might try taking a print-out of this blog post to someone skilled in Unix/MacOS and see if they can help you out.
Good luck!
You saved my day. I connected the faulty machine to another Mac via FireWire and started in Target Mode (hold down the “T” while starting) and proceeded to delete the faulty files.
A great way to solve the problem of having to understand the Unix command line utilities, Andrew! If you have another (working) Mac around, your suggestion is definitely the way to go.
Thank you! Creating another account with admin rights and deleting the offending launch service files fixed this problem. Much appreciated!
Thanks a lot, saved my day.
You’re Great. Thank you it worked perfectly!
we see logon looping problem while authenticating to a particualr website, could you please suggest if this solution will work for this kind of problem. Browsers that I’ve tried are firefox and safari, after entering my credentials the site tries to download an activeX control that is necessary to access this site. After this, I fall back on the same logon page? Any clue please? Thanks
Manish — this solution is for login loops at the operating system level (e.g. when the computer first starts), not for websites. Sorry, I don’t have any suggestions for the problem you are seeing. Good luck.
This fixed the problem for me!!!
Thanks!!!
You saved my day!
After reading more than 100 blog entries, I finally found this one.
Removing com.apple.LaunchServices-* in /Library/Caches solved my login problem and I can finally log into my usual account.
Thanks!
I just installed the 10.5.5. update, was stuck in a login loop, logged in as root and saw the launchd crashes in the log. I searched for help and found this page, and I just cannot thank you enough for the time you just saved me. Safe boot and disabling login items did not help me, BTW.
Amazing, worked like a charm. Thank goodness for people who know what they’re doing!
These commands can be used by using single user above or by ssh from another machine.
follow these commands (n.b.: dont type “>”
> sudo -s (you will be asked to type your admin password (unless your root password is different)
typing sudo -s puts you as root, which is a super user that can do everything basically so be careful. If you are not asked for your password, you are already root so move on.
> rm /Library/Caches/com.apple.LaunchServices*
rm = remove - this will remove a file from the directory/folder Caches in the library folder on the root of the harddrive. The file we want to delete “com.apple.LaunchServices-023uid.csstore” is the one causing the problem, however, there can be a few of them in the folder so we add a wildcard “*” to the end of the name to delete everything in that folder with “com.apple.LaunchServices”
> reboot
Reboots the machine and brings you back to the login screen.
I hope this helps people asking for instructions on how to follow the post.
Thanks for posting the summary of instructions, Ray. I edited your comment to correct one typo (”om” to “com”).
Wow, you really helped a brother out - and I mean Andrew as well. Single user mode loads a read-only file system and deleting files is not allowed even with sudo, contrary to what a few people said here. Andrew was right though - target disk mode into another mac is the easiest thing (at least for me). Apple should pay you with a money and praise for giving people what they should be giving them: a quick and easy solution instead of reinstalling the OS!!
Thanks for the complement, Michael. You are correct that under normal circumstances, a boot into single-user mode does not allow one to make modifications to the disk. (The disk is mounted in read-only mode.) One can use the following command, though, immediately after booting into single user mode to enable read-write access to the disk: mount -uw /
You described my problem with my day-by-day account on MacOS X Leopard 10.5.5. I already had the idea of a problem with the launch items, but I overloooked the existence of launch services outside of my Account/Library/Caches. With the root a account I solved it in few seconds.
Thx you made my day.
Thank you, thank you, thank you. Took forever to find this page but glad I did. So easy, especially in Target mode.
You saved my mac, my user and quite possibly, my job!
Cheers!
3 Trackbacks
[...] I stumbled upon a post on a third party site that solved the problem. Basically my login caches had become corrupt. To fix it you have to remove (or move out of the [...]
Post a Comment