Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

locationd keeps crashing every 3 seconds

I tried:

  • rebooting in recovery mode and repair disk permissions
  • disabling location services


And I keep getting the following error messages in the console (eating up a lot of CPU cycles):

14/12/12 5:42:08.405 PM locationd[511]: NOTICE,Location icon should now be in state 0
14/12/12 5:42:08.405 PM locationd[511]: locationd was started after an unclean shutdown
14/12/12 5:42:08.920 PM locationd[511]: Could not prepare statement pragma auto_vacuum;, error code = 11, error message = database disk image is malformed
14/12/12 5:42:08.920 PM locationd[511]: database false error 11; deleting and exiting
14/12/12 5:42:08.920 PM locationd[511]: NOTICE,Killing locationd to resolve corrupted database.
14/12/12 5:42:09.374 PM ReportCrash[501]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
14/12/12 5:42:09.374 PM ReportCrash[501]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
14/12/12 5:42:09.374 PM ReportCrash[501]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
14/12/12 5:42:09.374 PM ReportCrash[501]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
14/12/12 5:42:09.374 PM ReportCrash[501]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
14/12/12 5:42:09.374 PM ReportCrash[501]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
14/12/12 5:42:09.374 PM ReportCrash[501]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
14/12/12 5:42:09.375 PM ReportCrash[501]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
14/12/12 5:42:09.375 PM ReportCrash[501]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
14/12/12 5:42:09.375 PM ReportCrash[501]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
14/12/12 5:42:09.425 PM com.apple.launchd[1]: (com.apple.locationd[511]) Job appears to have crashed: Illegal instruction: 4
14/12/12 5:42:09.425 PM com.apple.launchd[1]: (com.apple.locationd) Throttling respawn: Will start in 2 seconds
14/12/12 5:42:09.527 PM ReportCrash[501]: Saved crash report for locationd[511] version 1239.39 to /Library/Logs/DiagnosticReports/locationd_2012-12-14-174209_Jeromes-MacBook-Air.crash


The only way to stop it is to disable locationd in the terminal:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.locationd.plist


Is there a fix to this, instead of this workaround?

Posted on Dec 14, 2012 2:46 AM

Reply
44 replies

Dec 14, 2012 6:44 AM in response to Jerome Meyer

Try removing the locationd database, which is located in the hidden folder /var/db/locationd/


This database contains information on the programs that use the location services, and should be remade when you re-enable location services and use your various applications again.


To remove this database, first back up your system and then choose "Go to Folder" in the Finder's "Go" menu. Then enter "/var/db" in the text field that appears, and when the hidden "db" folder opens, delete the folder called "locationd" within it. After this, try re-enabling location services and see if the problem continues.

Dec 16, 2012 9:00 PM in response to Jerome Meyer

Back up all data.


If you have more than one user account, you must be logged in as an administrator to carry out these instructions.


Launch the Terminal application in any of the following ways:


☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)


☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.


☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.


Triple-click the line below to select it, then drag or copy into the Terminal window — do not type — and press return:


sudo find /var/folders -user _locationd -name C -delete


You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. You don't need to post the warning. If you don’t have a login password, you’ll need to set one before you can run the command.


Reboot and see whether there's any improvement.

Dec 16, 2012 9:23 PM in response to Linc Davis

Triple-click the line below to select it, then drag or copy into the Terminal window — do not type — and press return:


sudo find /var/folders -user _locationd -name C -delete


Just tried this, but it didn't resolve the issue either. I can check the 'Enable Location Services' box, it'll stay checked for a few seconds then I get a beachball - and it will uncheck itself right after that.


I did quite a bit of Googling around and can't seem to find a procedure to rebuild this locationd DB... Which looks like it's the culprit here.

Dec 16, 2012 9:39 PM in response to Jerome Meyer

Please read this whole message before doing anything.

This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
The purpose of the test is to determine whether your problem is caused by third-party system modifications that load automatically at startup or login.


Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:

  • Shut down your computer, wait 30 seconds, and then hold down the shift key while pressing the power button.
  • When you see the gray Apple logo, release the shift key.
  • If you are prompted to log in, type your password, and then hold down the shift key again as you click Log in.
*Note: If FileVault is enabled under OS X 10.7 or later, or if a firmware password is set, or if the boot volume is a software RAID, you can’t boot in safe mode.


Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.


Test while in safe mode. Same problem?


After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

Dec 16, 2012 10:49 PM in response to Linc Davis

Here's what I've got (extract of about 10 seconds); I also attach a screenshot, which is a bit more legible than the formatting below (click to enlarge). Appreciate your help on this!

UID PID COMM FD PATH

205 1998 locationd 3 /dev/autofs_nowait

205 1998 locationd -1 /var/db/locationd/.CFUserTextEncoding

205 1998 locationd 3 /dev/autofs_nowait

205 1998 locationd -1 /var/db/locationd/.CFUserTextEncoding

205 1998 locationd -1 /var/db/locationd/com.apple.locationd.migrated.plist

205 1998 locationd 3 /usr/libexec

205 1998 locationd 3 /usr/libexec/locationd

205 1998 locationd -1 /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F12A-27CD- 5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.notbac kedup.98C0F12A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd 13 /var/folders/zz/zyxvpxvq6csfxvn_n00000sm00006d/C/cache_encryptedA.db

205 1998 locationd 4 /var/folders/zz/zyxvpxvq6csfxvn_n00000sm00006d/C/cache.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd 4 /usr/share/icu/icudt49l.dat

205 1998 locationd 4 /etc/localtime

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd -1 /private/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.98C0F1 2A-27CD-5A23-BC1F-54BDA1A6DA9C.plist

205 1998 locationd 4 /var/db/locationd/clients.plist

User uploaded file

locationd keeps crashing every 3 seconds

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.