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 0×00192FD4): “pmap_flush_tlbs() timeout: ” “cpu 1 failing to respond to interrupts, pmap=0×536500 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)
0×5c4ff258 : 0×12b0fa (0×4592a4 0×5c4ff28c 0×133243 0×0)
0×5c4ff2a8 : 0×192fd4 (0×45f414 0×1 0×536500 0×2)
0×5c4ff318 : 0×194126 (0×536500 0×4fa0c000 0×0 0×162a55)
0×5c4ff3b8 : 0×17406e (0xbb33b 0×0 0×7000 0×0)
0×5c4ff458 : 0×169e3a (0xc971578 0×0 0×0 0×8000)
0×5c4ff578 : 0×16a437 (0×4fa14000 0×0 0×0 0×0)
0×5c4ff5b8 : 0×18249d (0×1c3cd20 0×4fa0c000 0×0 0×4fa14000)
0×5c4ff618 : 0×42d290 (0×1c3cd20 0×4fa0c000 0×0 0×8000)
0×5c4ff678 : 0×42d2f4 (0×8ee8780 0×1c3cf78 0×131dad40 0×0)
0×5c4ff698 : 0×42d3e5 (0×131dad40 0×0 0×79fad400 0×0)
0×5c4ff6b8 : 0×42d3bc (0×131dad40 0×0 0×2 0×0)
0×5c4ff6d8 : 0×3eb869 (0×131dad40 0×0 0×5c4ff758 0×5c4ffb50)
0×5c4ff6f8 : 0xfcad52 (0×131dad40 0×7663c00 0×4ff708 0×3a3)
0×5c4ff758 : 0xfcb247 (0×46d1a000 0×7663c00 0×50e8d080 0×2952f080)
0×5c4ff7b8 : 0xfcb681 (0×46d1a000 0×7663c00 0×5c4ffb54 0×5c4ffb58)
0×5c4ff818 : 0xf9f726 (0×46d1a000 0×5c4ffacc 0×5c4ffa7c 0×5c4ffb54)
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)@0×5c1000
dependency: com.apple.iokit.IOGraphicsFamily(1.5.2)@0xaf8000

BSD process name corresponding to current thread: WindowServer

Mac OS version:
9E17

Kernel 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 0×919366e8 objc_msgSend + 24
1 …ple.ApplicationServices.ATS 0×90fc2395 LLCStyleInfoCreateActiveStyleInfo + 713
2 com.apple.QD 0×908101eb TATSUStyle::ConstructActiveStyleInfo() + 43
3 com.apple.QD 0×90826165 TATSUStyle::GetStyleInfo(LLCStyleInfo const**) + 27
4 com.apple.QD 0×90825f39 TTextLineLayout::ConstructGlyphRecordArrayWithVirtualGlyphs(TATSUGlyphRecordArray*, unsigned long*) + 205
5 com.apple.QD 0×9082568f TTextLineLayout::ConstructGlyphRecordArray(TATSUGlyphRecordArray*, TLayoutControls*) + 689
6 com.apple.QD 0×908372c3 TTextLineLayout::EnsureLayoutIsUpToDate(unsigned long, unsigned char, unsigned long, TATSUGlyphRecordArray**) + 713
7 com.apple.QD 0×90841ecd TTextLineLayout::GetGlyphBounds(unsigned long, unsigned long, long, long, unsigned short, unsigned long, ATSTrapezoid*, unsigned long*) + 185
8 com.apple.QD 0×90841dfe ATSUGetGlyphBounds + 136
9 XUL 0×0150308d gfxPlatformMac::gfxPlatformMac() + 351
10 XUL 0×01504af8 gfxAtsuiFontGroup::GuessMaximumStringLength() + 4516
11 XUL 0×01504e38 gfxAtsuiFontGroup::GuessMaximumStringLength() + 5348
12 XUL 0×0150506d gfxAtsuiFontGroup::GuessMaximumStringLength() + 5913
13 XUL 0×01505c80 gfxAtsuiFontGroup::FindATSUFont(nsAString_internal const&, nsACString_internal const&, void*) + 112
14 XUL 0×014f520b gfxFontGroup::FontResolverProc(nsAString_internal const&, void*) + 31
15 XUL 0×01502867 gfxPlatformMac::ResolveFontName(nsAString_internal const&, int (*)(nsAString_internal const&, void*), void*, int&) + 155
16 XUL 0×014f990a gfxFontGroup::ForEachFontInternal(nsAString_internal const&, nsACString_internal const&, int, int, int (*)(nsAString_internal const&, nsACString_internal const&, void*), void*) + 2064
17 XUL 0×014f9a55 gfxFontGroup::ForEachFont(int (*)(nsAString_internal const&, nsACString_internal const&, void*), void*) + 57
18 XUL 0×015074d2 gfxAtsuiFontGroup::gfxAtsuiFontGroup(nsAString_internal const&, gfxFontStyle const*) + 86
19 XUL 0×01502433 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.

Using YASU to clean corrupt font caches

Using YASU to clean corrupt font caches

Comments:


Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:

(required)

(required)