Closed Bug 636957 Opened 9 years ago Closed 5 months ago

Crash in gfxFontGroup::BuildFontList close to startup with abort message: "unable to find a usable font (serif)"

Categories

(Core :: Graphics, defect, P3, critical)

2.0 Branch
x86
Windows 7
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: scoobidiver, Unassigned)

References

Details

(Keywords: crash, regression, Whiteboard: [startupcrash][tbird crash][gfx-noted])

Crash Data

Attachments

(1 file)

It is a new crash signature in 4.0b12 or a one hidden behind the generic mozalloc_abort(char const* const) | NS_DebugBreak_P crash signature.
It is similar to bug 628207 that has been marked as fixed.

Signature	mozalloc_abort(char const* const) | NS_DebugBreak_P | gfxFontGroup::BuildFontList()
UUID	46770e36-1c04-49b7-ae6c-663742110225
Time 	2011-02-25 18:43:19.504073
Uptime	26
Last Crash	145 seconds before submission
Install Age	236 seconds (3.9 minutes) since version was first installed.
Product	Firefox
Version	4.0b12
Build ID	20110222210221
Branch	2.0
OS	Windows NT
OS Version	6.1.7600
CPU	x86
CPU Info	GenuineIntel family 6 model 37 stepping 5
Crash Reason	EXCEPTION_BREAKPOINT
Crash Address	0x71c11a39
App Notes 	AdapterVendorID: 8086, AdapterDeviceID: 0046, AdapterDriverVersion: 8.15.10.2202
xpcom_runtime_abort(###!!! ABORT: unable to find a usable font (serif): file e:/builds/moz2_slave/rel-cen-w32-bld/build/gfx/thebes/gfxFont.cpp, line 2014)

Frame 	Module 	Signature [Expand] 	Source
0 	mozalloc.dll 	mozalloc_abort 	memory/mozalloc/mozalloc_abort.cpp:77
1 	xul.dll 	NS_DebugBreak_P 	xpcom/base/nsDebugImpl.cpp:350
2 	xul.dll 	gfxFontGroup::BuildFontList 	
3 	xul.dll 	gfxFontGroup::gfxFontGroup 	gfx/thebes/gfxFont.cpp:1961
4 	xul.dll 	gfxWindowsPlatform::CreateFontGroup 	gfx/thebes/gfxWindowsPlatform.cpp:538
5 	xul.dll 	nsThebesFontMetricsConstructor 	gfx/src/thebes/nsThebesGfxFactory.cpp:52
6 	xul.dll 	mozilla::GenericFactory::CreateInstance 	obj-firefox/xpcom/build/GenericFactory.cpp:48
7 	xul.dll 	nsRefPtr<nsPresContext>::~nsRefPtr<nsPresContext> 	obj-firefox/xpcom/build/nsCOMPtr.cpp:81
8 	xul.dll 	nsFontCache::GetMetricsFor 	gfx/src/thebes/nsThebesDeviceContext.cpp:181
9 	xul.dll 	nsCOMPtr_base::assign_with_AddRef 	obj-firefox/xpcom/build/nsCOMPtr.cpp:88
10 		@0x6ca56b7

More reports at:
https://crash-stats.mozilla.com/report/list?range_value=4&range_unit=weeks&signature=mozalloc_abort%28char%20const*%20const%29%20|%20NS_DebugBreak_P%20|%20gfxFontGroup%3A%3ABuildFontList%28%29
I think this is a regression from the delayed initialization of the DWrite font list in bug 602792. The only way we should be able to hit this runtime-abort is if there are no usable font families in the list returned by GetFontFamilyList; but that would be an empty list if the delayed-init has not yet happened.
Blocks: 602792
Keywords: regression
OS: Windows 7 → Windows XP
Assignee: nobody → jfkthame
Attachment #515332 - Flags: review?(jdaggett)
OS: Windows XP → Windows 7
Attachment #515332 - Attachment description: patch (untested) - ensure the font list is initialized → patch - ensure the font list is initialized
Looking at the crash reports again, it appears that some of them are on systems with no DWrite, so those instances can't be due to the bug 602792 change. But we should fix the possible GetFontFamilyList() issue for the DWrite version anyway, and see if that has an impact on crash frequency.
Comment on attachment 515332 [details] [diff] [review]
patch - ensure the font list is initialized

The patch seems fine, you're right that it catches a possible init path.  But it's not the source of the bug.  The GetFontFamilyList method is only called in gfxFontGroup::BuildFontList but before it's called GetDefaultFont is called which calls through to FindFamily.  FindFamily already contains the init logic so I don't see a code path for hitting the init code in your patch.  It's a good thing to fix just in case the code changes in the future.

We should leave this bug as open after landing this patch.
Attachment #515332 - Flags: review?(jdaggett) → review+
Landed this patch on m-c:
http://hg.mozilla.org/mozilla-central/rev/0138798a072a

Keeping bug open as this cannot account for all the crashes, it's more a precautionary fix.
AFAICS, these crashes appear to have stopped: I can't find anything on crash-stats for builds later than 2011-04-14. It's not clear why, though; as per comments above, the patch here does _not_ seem able to account for the improvement.
(In reply to comment #6)
> AFAICS, these crashes appear to have stopped: I can't find anything on
> crash-stats for builds later than 2011-04-14.
It is only #293 top crasher in 4.0.1 over the last week. Moreover, there have been only 2 crashes in 6.0a1 and 2 crashes in 5.0a2 for 4 weeks. So I don't think it is representative.
Crash Signature: [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | gfxFontGroup::BuildFontList() ]
(In reply to Jonathan Kew (:jfkthame) from comment #6)
> AFAICS, these crashes appear to have stopped: I can't find anything on
> crash-stats for builds later than 2011-04-14. It's not clear why, though; as
> per comments above, the patch here does _not_ seem able to account for the
> improvement.

still happening with solid numbers, though not in top 300 for either Firefox or Thunderbird

did it stop and come back from other cause?
Whiteboard: [startupcrash][tbird crash]
Summary: Crash [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | gfxFontGroup::BuildFontList() ] close to startup → Crash in gfxFontGroup::BuildFontList close to startup with abort message: "unable to find a usable font (serif)"
Crash Signature: [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | gfxFontGroup::BuildFontList() ] → [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | gfxFontGroup::BuildFontList() ] [@ mozalloc_abort(char const* const) | NS_DebugBreak] [@ mozalloc_abort(char const* const) | NS_DebugBreak | gfxFontGroup::BuildFontList() ]
Duplicate of this bug: 709474
The bug also occurs on OSX with almost as many crashes as on Windows.
Summing up the different signatures puts it in the top 25 or so.

https://crash-stats.mozilla.com/query/?product=Firefox&version=ALL%3AALL&query_search=signature&query_type=contains&query=gfxFontGroup%3A%3ABuildFontList
Crash Signature: [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | gfxFontGroup::BuildFontList() ] [@ mozalloc_abort(char const* const) | NS_DebugBreak] [@ mozalloc_abort(char const* const) | NS_DebugBreak | gfxFontGroup::BuildFontList() ] → [@ mozalloc_abort(char const* const) | NS_DebugBreak_P | gfxFontGroup::BuildFontList() ] [@ mozalloc_abort(char const* const) | NS_DebugBreak] [@ mozalloc_abort(char const* const) | NS_DebugBreak | gfxFontGroup::BuildFontList() ] [@ mozalloc_abort(char…
jdaggett has been working on the font-list code more recently than me, I think; probably best if he takes a look at this.
Assignee: jfkthame → jdaggett
(In reply to Jonathan Kew (:jfkthame) from comment #11)
> jdaggett has been working on the font-list code more recently than me, I
> think; probably best if he takes a look at this.

There definitely appears to be an uptick in these recently, quite possibly something to do with the fontlist reworking I did on bug 280443. I'll spin off a new bug, as this appears to be a grab bag bug and it looks like the recent crashes are tied to OSX.
Depends on: 1070983
Not sure if it helps, but I hit this today in OS X 10.10 https://crash-stats.mozilla.com/report/index/69a6649d-4685-4949-ba8d-de8ad2141104, when I was installing these fonts with Font Book https://github.com/adobe-fonts/source-code-pro/releases/tag/1.017R.  After they installed, it brought down Firefox.
(In reply to David Humphrey (:humph) from comment #13)
> Not sure if it helps, but I hit this today in OS X 10.10
> https://crash-stats.mozilla.com/report/index/69a6649d-4685-4949-ba8d-
> de8ad2141104, when I was installing these fonts with Font Book
> https://github.com/adobe-fonts/source-code-pro/releases/tag/1.017R.  After
> they installed, it brought down Firefox.

That is interesting. Any idea what page(s) you had open when it crashed? I suspect that may not be relevant but it might be. Adding a font causes the system fontlist to be rebuilt and the subsequent crash is "can't find any fonts on the system", which means for some reason the system fontlist is not getting properly regenerated.

While Firefox is open, if you disable Source Code Pro in FontBook, wait 15 seconds, then re-enable it, do you see a crash? (select font and use Edit > Disable xxx)
No, I have no more info.  It was a one-time thing I've never seen again.  I suspect it related to the fact that I'd just updated my OS at the same time, and installing these coincided with needing to somehow rebuild the fontlist.  Sorry I have no more to offer.
Firefox had very regularly crashed after my Mac wake up from sleep. I saw some messages "unable to find a usable font" in the logs. 
I checked my fonts with the "Font Book" application from Apple, which indicates some ill-formed fonts, warnings and duplicated. It's not a big surprise because I took lots of data, apps, fonts etc over from previous system (partly from MacOS9). Since I cleaned up the font problems and most warnings, I didn't experienced a crash any more.
Depends on: 1189129
Crash Signature: mozalloc_abort(char const*) | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList() ] → mozalloc_abort(char const*) | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList() ] [@ mozalloc_abort | NS_DebugBreak_P | gfxFontGroup::BuildFontList ] [@ mozalloc_abort | NS_DebugBreak] [@ mozalloc_abort | NS_DebugBreak | gfxFontGroup::BuildFontLis…
Assignee: jd.bugzilla → nobody
We only get reports for these signatures now but are isolated to Firefox 28 and earlier:
> mozalloc_abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> mozalloc_abort | NS_DebugBreak_P | gfxFontGroup::BuildFontList

There are however a bunch of other similar signatures but these are isolated to Firefox 34 and earlier:
> Abort | unable to find a usable font (serif) | mozalloc_abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> Abort | unable to find a usable font (serif) | mozalloc_abort | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> Abort | unable to find a usable font ('Open Sans Light',X-LocaleSpecific-Light,'Open ... | mozalloc_abort | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> Abort | unable to find a usable font (Lucida Grande) | mozalloc_abort | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> Abort | unable to find a usable font (.Helvetica Neue DeskInterface) | mozalloc_abort | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> Abort | unable to find a usable font (.SF NS Text) | mozalloc_abort | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> Abort | unable to find a usable font (Helvetica,Arial,sans-serif) | mozalloc_abort | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> Abort | unable to find a usable font (Segoe UI) | mozalloc_abort | NS_DebugBreak | gfxFontGroup::BuildFontList
> Abort | unable to find a usable font (sans-serif) | mozalloc_abort | Abort | NS_DebugBreak | gfxFontGroup::BuildFontList

If anyone following this bug was able to reproduce the bug before, can you please check again with the current Nightly build?
Whiteboard: [startupcrash][tbird crash] → [startupcrash][tbird crash][gfx-noted]
Version: Trunk → 2.0 Branch

Closing because no crashes reported for 12 weeks.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.