A possible solution for system hang on Safari launch

Nov 24, '09 07:30:03AM

Contributed by: williamvanetten

Recently, any time I tried to run Safari on 10.6 caused all apps and the Finder to hang with the spinning beach ball. Force-quitting Safari stopped the problem, but it would occur again on the next launch. Googling around, I saw many folks reporting similar problems, but no solutions.

The /var/log/system.log file shows something like this when this hang occurs:

Nov 13 09:51:16 bvmbook Safari[394]: INSERT-HANG-DETECTED: Tx time:46.498542, # of Inserts: 0, # of bytes written: 0, Did shrink: YES

Sounds like a database problem. So I looked at which database-type files were opened by Safari, with this in Terminal:

sh-3.2# lsof / | grep Safari |grep db
Safari    544       vanetten  txt    REG   14,2     32768 3762252 /private/var/db/mds/messages/se_SecurityMessages
Safari    544       vanetten  txt    REG   14,2     51288 3764181 /private/var/folders/L2/L2wz7UsyFWOAKlDB6i6RqE+++TM/-Caches-/mds/mdsDirectory.db
Safari    544       vanetten  txt    REG   14,2 197840896 3762198 /private/var/db/dyld/dyld_shared_cache_x86_64
Safari    544       vanetten    5u   REG   14,2     36864 3764157 /Users/vanetten/Library/Safari/WebpageIcons.db
Safari    544       vanetten    6u   REG   14,2  39143424 2858942 /private/var/folders/L2/L2wz7UsyFWOAKlDB6i6RqE+++TM/-Caches-/com.apple.Safari/SafeBrowsing.db
Safari    544       vanetten    7u   REG   14,2    724992 3764162 /Users/vanetten/Library/Caches/com.apple.Safari/Cache.db
I found that if I quit Safari and deleted the *.db files in my home directory, the problem goes away:
sh-3.2# rm /Users/vanetten/Library/Safari/WebpageIcons.db /Users/vanetten/Library/Caches/com.apple.Safari/Cache.db /Users/vanetten/Library/Caches/com.apple.Safari/Cache.db-journal
I'm not sure which of these files were corrupt, but launching Safari seems to re-create them.

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20091113081849404