Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

A possible solution for system hang on Safari launch Web Browsers
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.
    •    
  • Currently 2.88 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (16 votes cast)
 
[3,398 views]  

A possible solution for system hang on Safari launch | 3 comments | Create New Account
Click here to return to the 'A possible solution for system hang on Safari launch' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
A possible solution for system hang on Safari launch
Authored by: amoeba54 on Tue, Nov 24 2009 at 9:31AM PST
I've had a hang on loading of Safari for some time but no entries in my error log. I only use Safari occasionally so it hasn't been a big deal.

Deleted ~/Library/Application Support/Safari alltogether things seem peachy now. First launch took a while, must've been creating its databases. Subsequent launches are no longer hanging.

Thanks for the idea!

[ Reply to This | # ]
A possible solution for system hang on Safari launch
Authored by: umijin on Wed, Nov 25 2009 at 6:48AM PST
I’m having the same problem on my MB Air, but usually only when I'm accessing the net from networks outside my home (work & lab). I'll give your fix a try.

[ Reply to This | # ]
A possible solution for system hang on Safari launch
Authored by: Brad Puett on Tue, Dec 8 2009 at 5:43PM PST
Wouldn't it be better to post these commands to remove the files with a tilde "~" instead of leaving in "/Users/vanetten" ?

So the commands should be

rm ~/Library/Safari/WebpageIcons.db ~/Library/Caches/com.apple.Safari/Cache.db ~/Library/Caches/com.apple.Safari/Cache.db-journal

OR (if you like single commands)

rm ~/Library/Safari/WebpageIcons.db
rm ~/Library/Caches/com.apple.Safari/Cache.db
rm ~/Library/Caches/com.apple.Safari/Cache.db-journal

(I couldn't find that user named "vanetten" anywhere on my system! :^)

Interestingly, I could delete the 1st two files, but didn't have the "Cache.db-journal" file ...

[ Reply to This | # ]