While I have been enjoying my Mac as of late, I find myself doing some Googling to resolve odd crashes of services I have no special knowledge of.
Case in point: helpd
Helpd, or Help Daemon, is a daemon that runs in the background for help service.
Ultimately, I was presented with this problem:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)<br />
Exception Codes: KERN_INVALID_ADDRESS at 0x000000000000003a
Occasionally, the daemon decides it’s time to run helpd.
We can determine what, exactly, triggers helpd by looking at the plist file for it. Specifically, it’s found in /System/Library/LaunchAgents/com.apple.helpd.plist. Here’s an interesting bit:
<key>WatchPaths</key><br />
<array><br />
<string>/Applications/</string><br />
<string>/Applications/Utilities/</string><br />
</array>
Ah ha, so now we know that helpd gets started with anything in the /Applications or /Applications/Utilities directory changes (There are other things that trigger it at well.)
I could consistently reproduce the crash by running touch /Applications from Terminal, which triggered the daemon.
I decided to pop open Console to see if anything was able to point me in the right direction. (Warning: Extreme sarcasm ahead) Of course, I got this wonderful bit of diagnostic information:
6/18/12 9:11:21.180 AM helpd: CarbonCore.framework: Unable to connect to coreservicesd. Things likely won’t work. Sorry.
Apology excepted. Moving on, I found this in the Console along the same time.
6/17/12 2:34:15.314 AM helpd: Error trying to unarchive index data. Original path
is </Users/kjones/Library/Caches/com.apple.helpd/Generated/com.apple.iWork.Keynote.help/English.helpindex>. Error: *** -initForReadingWithData: nil argument
Hm, so something is wrong with the content in a caches directory. Generally speaking, it’s safe to delete things in ~/Library/Caches, so I decided to delete ~/Library/Caches/com.apple.helpd, which is easy enough to do from the Terminal:
rm -rf ~/Library/Caches/com.apple.helpd
Afterwards, I ran touch /Applications, and helpd promptly spun up. After a few minutes of waiting, supposedly to rebuild the cache, it completed without any errors.
I’m happy enough that the problem is resolved, but I can’t help but wonder why helpd couldn’t resolve this problem itself. It knew there was something wrong with the cache, and logged it.