Spotlight became “sputter-heavy”
I was having problems with Spotlight on Leopard 10.5.1. My computer was dog-slow and just plain unresponsive. Spotlight search results were inconsistent and I was noticing that my drive was being re-indexed quite regularly (as evidenced by the spotlight menu item and the concealed progress bar).
My first troubleshooting step was to fire up Spotless to delete the indexes and allow them to rebuild. Unfortunately, 24 hours later the indexing was still going. My index kept stalling at around 127MB.
I used the following code to check it.
sudo du -h /.Spotlight-V100/
After watching it for about and hour, I decided to upgrade to a self-running version with Growl notifications.
while :
do
clear
sudo du -h /.Spotlight-V100/ | /usr/local/bin/growlnotify
echo “growled” & date “+%H:%M:%S%n”
sleep 90
done
Some searching revealed that quite a number of people had experienced this problem at the release of 10.5.1. My standard tracing solution didn’t tell me too much.
lsof | grep mdworker
But, anther user explained how to use the dtrace system utility to examine the mdworker process. On my system it was using 90-100% processor time.
sudo dtrace -n ‘syscall::open*:entry /execname == “mdworker” | execname == “mds”/ { printf("%Y %u %s %s",walltimestamp,pid,execname,copyinstr(arg0)); }’
This led me to examine the console and sure enough, the mdworker was crashing every 3 secs on a particular file and writing a crashlog.
Jan 30 23:55:07 Macintosh ReportCrash2692: Formulating crash report for process mds2686
Jan 30 23:55:07 Macintosh com.apple.launchd[1] (0x10c830.mdworker2687): Exited: Terminated
Jan 30 23:55:07 Macintosh com.apple.launchd[1] (0x10c9f0.mdworker2690): Exited: Terminated
Jan 30 23:55:07 Macintosh com.apple.launchd[1] (0x10cbb0.mdworker2691): Exited: Terminated
Jan 30 23:55:07 Macintosh com.apple.launchd[1] (com.apple.metadata.mds2686): Exited abnormally: Segmentation fault
Jan 30 23:55:07 Macintosh mds2695: (/.Spotlight-V100/Store-V1/Stores/9A285684-2061-4212-B186-56B95ACE8BD7)(Error) IndexCI in ContentIndexOpenBulk:No index
Jan 30 23:55:07 Macintosh ReportCrash2692: Saved crashreport to /Library/Logs/CrashReporter/mds_2007-11-12-235505_Macintosh.crash using uid: 0 gid: 0, euid: 0 egid: 0
After poking about for a while I settled on the same solution as many others- an OS reinstall. Archive & Install worked fine and the entire process, including software updates, took about 90 minutes.
Fixed.
