Firefox 3 (+possibly other apps) random crashing on OS X due to font cache corruption
One day Firefox 3.0.8 started randomly crashing on me, and some other folks as well. It is not possible to remember anymore whether there was a system crash / kernel panic / unclean shutdown beforehand. PanicReporter does show one for Mar 10, 2009, which actually sets the timeline for this problem up quite well.
Tue Mar 10 12:59:47 2009
panic(cpu 0 caller 0x00192FD4): “pmap_flush_tlbs() timeout: ” “cpu 1 failing to respond to interrupts, pmap=0x536500 cpus_to_signal=2″@/SourceCache/xnu/xnu-1228.5.20/osfmk/i386/pmap.c:4570
Backtrace, Format – Frame : Return Address (4 potential args on stack)
0x5c4ff258 : 0x12b0fa (0x4592a4 0x5c4ff28c 0x133243 0x0)
0x5c4ff2a8 : 0x192fd4 (0x45f414 0x1 0x536500 0x2)
0x5c4ff318 : 0x194126 (0x536500 0x4fa0c000 0x0 0x162a55)
0x5c4ff3b8 : 0x17406e (0xbb33b 0x0 0x7000 0x0)
0x5c4ff458 : 0x169e3a (0xc971578 0x0 0x0 0x8000)
0x5c4ff578 : 0x16a437 (0x4fa14000 0x0 0x0 0x0)
0x5c4ff5b8 : 0x18249d (0x1c3cd20 0x4fa0c000 0x0 0x4fa14000)
0x5c4ff618 : 0x42d290 (0x1c3cd20 0x4fa0c000 0x0 0x8000)
0x5c4ff678 : 0x42d2f4 (0x8ee8780 0x1c3cf78 0x131dad40 0x0)
0x5c4ff698 : 0x42d3e5 (0x131dad40 0x0 0x79fad400 0x0)
0x5c4ff6b8 : 0x42d3bc (0x131dad40 0x0 0x2 0x0)
0x5c4ff6d8 : 0x3eb869 (0x131dad40 0x0 0x5c4ff758 0x5c4ffb50)
0x5c4ff6f8 : 0xfcad52 (0x131dad40 0x7663c00 0x4ff708 0x3a3)
0x5c4ff758 : 0xfcb247 (0x46d1a000 0x7663c00 0x50e8d080 0x2952f080)
0x5c4ff7b8 : 0xfcb681 (0x46d1a000 0x7663c00 0x5c4ffb54 0x5c4ffb58)
0x5c4ff818 : 0xf9f726 (0x46d1a000 0x5c4ffacc 0x5c4ffa7c 0x5c4ffb54)
Backtrace continues…
Kernel loadable modules in backtrace (with dependencies):
com.apple.GeForce(5.2.8)@0xf5d000->0xfebfff
dependency: com.apple.NVDAResman(5.2.8)@0xb22000
dependency: com.apple.iokit.IONDRVSupport(1.5.2)@0xb14000
dependency: com.apple.iokit.IOPCIFamily(2.4.1)@0x5c1000
dependency: com.apple.iokit.IOGraphicsFamily(1.5.2)@0xaf8000BSD process name corresponding to current thread: WindowServer
Mac OS version:
9E17Kernel version:
Darwin Kernel Version 9.4.0: Mon Jun 9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
System model name: MacBookPro3,1 (Mac-F42388C8)
There was no persistent pattern to Firefox crashes, except it would be during loading a web page after an action. Sometimes I would click on a link, sometimes submit a form and the crashes would occur on different sites. At first I obviously suspected Firefox addons, but disabling these back and forth would seem to make no difference. First clue was given to me when I decided to enable OS X crash reporter as well, besides the built in Mozilla one.
defaults write org.mozilla.firefox OSCrashReporter 1
Later I found out that uploading the crash data with Mozilla’s tool and then doing:
about:crashes
would give me access to the same information on Mozilla bugs website. Either way, the crash log showed me:
Thread 0:
0 libobjc.A.dylib 0x919366e8 objc_msgSend + 24
1 …ple.ApplicationServices.ATS 0x90fc2395 LLCStyleInfoCreateActiveStyleInfo + 713
2 com.apple.QD 0x908101eb TATSUStyle::ConstructActiveStyleInfo() + 43
3 com.apple.QD 0x90826165 TATSUStyle::GetStyleInfo(LLCStyleInfo const**) + 27
4 com.apple.QD 0x90825f39 TTextLineLayout::ConstructGlyphRecordArrayWithVirtualGlyphs(TATSUGlyphRecordArray*, unsigned long*) + 205
5 com.apple.QD 0x9082568f TTextLineLayout::ConstructGlyphRecordArray(TATSUGlyphRecordArray*, TLayoutControls*) + 689
6 com.apple.QD 0x908372c3 TTextLineLayout::EnsureLayoutIsUpToDate(unsigned long, unsigned char, unsigned long, TATSUGlyphRecordArray**) + 713
7 com.apple.QD 0x90841ecd TTextLineLayout::GetGlyphBounds(unsigned long, unsigned long, long, long, unsigned short, unsigned long, ATSTrapezoid*, unsigned long*) + 185
8 com.apple.QD 0x90841dfe ATSUGetGlyphBounds + 136
9 XUL 0x0150308d gfxPlatformMac::gfxPlatformMac() + 351
10 XUL 0x01504af8 gfxAtsuiFontGroup::GuessMaximumStringLength() + 4516
11 XUL 0x01504e38 gfxAtsuiFontGroup::GuessMaximumStringLength() + 5348
12 XUL 0x0150506d gfxAtsuiFontGroup::GuessMaximumStringLength() + 5913
13 XUL 0x01505c80 gfxAtsuiFontGroup::FindATSUFont(nsAString_internal const&, nsACString_internal const&, void*) + 112
14 XUL 0x014f520b gfxFontGroup::FontResolverProc(nsAString_internal const&, void*) + 31
15 XUL 0x01502867 gfxPlatformMac::ResolveFontName(nsAString_internal const&, int (*)(nsAString_internal const&, void*), void*, int&) + 155
16 XUL 0x014f990a gfxFontGroup::ForEachFontInternal(nsAString_internal const&, nsACString_internal const&, int, int, int (*)(nsAString_internal const&, nsACString_internal const&, void*), void*) + 2064
17 XUL 0x014f9a55 gfxFontGroup::ForEachFont(int (*)(nsAString_internal const&, nsACString_internal const&, void*), void*) + 57
18 XUL 0x015074d2 gfxAtsuiFontGroup::gfxAtsuiFontGroup(nsAString_internal const&, gfxFontStyle const*) + 86
19 XUL 0x01502433 gfxPlatformMac::CreateFontGroup(nsAString_internal const&, gfxFontStyle const*) + 43
Launching Firefox from Terminal to catch any error messages gave me:
lkraav@mobilitymac ~ $ /Applications/Firefox.app/Contents/MacOS/firefox
lkraav@mobilitymac ~ $ Debugger() was called!
mobilitymac.local firefox-bin[92129]: GCGetStrikeMetrics failed: error 4.
Googling it led me here. It was interesting, because just recently Wine HQ website appeared completely text free in Firefox 3, to which I had no explanation. At the same time, it displayed fine in Safari. Initially, bells did not start to ring about this, though.
Well, doesn’t look like this crash has much to do with Firefox at all, but more like some wack problem with our friend ATSServer — Mac OS X system font manager or something related to the font system. Googling around for LLCStyleInfoCreateActiveStyleInfo fortunately showed me that this is a known crash type, but definitely not a widespread one. However, just looking for the above keyword, it appears Google hides the key search result item, while searching for LLCStyleInfoCreateActiveStyleInfo firefox brings it up:
Apple – Support – Discussions – Safari crashing on just one user account, ~Bee suggests:
Jake –
This is fun, eh?You might want to check your font manager for duplicate or corrupt fonts.
Also, you might want to clear the font cache.
I clear mine with a little app called YASU (free/shareware).
And Font Finagler is excellent, as well.
to which OP respons
Well, I did it. YASU’d my computer, and it seems to have worked! Very nice work, indeed, Bee.
By YASU, ~Bee means Yet Another System Utility for OS X.
After doing the following, Firefox has stopped crashing. Wine HQ website mentioned above also displays correctly.