Last Comment Bug 671385 - ASSERTION: no font metrics
: ASSERTION: no font metrics
Status: RESOLVED FIXED
: regression
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla8
Assigned To: Jonathan Kew (:jfkthame)
:
:
Mentors:
Depends on:
Blocks: 668758
  Show dependency treegraph
 
Reported: 2011-07-13 12:20 PDT by Benjamin Stover (:stechz)
Modified: 2011-07-26 11:07 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch, restore the recursive application of ForEachFontInternal to font names from preferences (1.05 KB, patch)
2011-07-16 06:21 PDT, Jonathan Kew (:jfkthame)
jd.bugzilla: review+
Details | Diff | Splinter Review

Description Benjamin Stover (:stechz) 2011-07-13 12:20:09 PDT
Fennec crashes on startup with these errors:

    WARNING: Subdocument container has no content: file /home/ben/projects/mc/layout/base/nsDocumentViewer.cpp, line 2418
    WARNING: Failed to find font entry for font!: file /home/ben/projects/mc/gfx/thebes/gfxFT2Fonts.cpp, line 885
    ###!!! ASSERTION: We need at least one font in a fontgroup: 'mFonts.Length() > 0', file /home/ben/projects/mc/gfx/thebes/gfxFT2Fonts.cpp, line 410
    WARNING: Failed to find font entry for font!: file /home/ben/projects/mc/gfx/thebes/gfxFT2Fonts.cpp, line 885
    ###!!! ASSERTION: We need at least one font in a fontgroup: 'mFonts.Length() > 0', file /home/ben/projects/mc/gfx/thebes/gfxFT2Fonts.cpp, line 410
    ###!!! ASSERTION: font metrics should not be null - bug 136248: 'NS_SUCCEEDED(rv)', file /home/ben/projects/mc/gfx/src/nsDeviceContext.cpp, line 229
    ###!!! ASSERTION: no font metrics: 'nsnull != aFontMetrics', file /home/ben/projects/mc/layout/generic/nsHTMLReflowState.cpp, line 2107 

Pulling right after the mozilla-inbound merge on mozilla-central (http://hg.mozilla.org/mozilla-central/rev/40a1936f6a2d).
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2011-07-14 10:36:08 PDT
Benjamin, if this is a regression that needs to be tracked for 8, please mark it so?
Comment 2 Benjamin Stover (:stechz) 2011-07-14 10:48:56 PDT
I don't understand. I thought tracking flags were important only if a patch doesn't make it to Aurora or Beta. This is on trunk and doesn't affect Aurora or Beta AFAIK.
Comment 3 Boris Zbarsky [:bz] (still a bit busy) 2011-07-14 10:54:11 PDT
Well, as long as you remember to add the tracking flag if this is still open when 8 merges to aurora....
Comment 4 Benjamin Stover (:stechz) 2011-07-14 11:27:39 PDT
I hope so, because I can't get work done until this is fixed. :)

Who could help me out with this?
Comment 5 John Daggett (:jtd) 2011-07-14 11:59:35 PDT
I'm guessing this was fixed by bug 668758, comment 10.
Comment 6 Benjamin Stover (:stechz) 2011-07-14 12:18:29 PDT
Unfortunately not. I pulled today and still crashing. I just noticed I am building with freetype and not pango (to closer match what Android does) so this is probably why.
Comment 7 Jonathan Kew (:jfkthame) 2011-07-14 13:12:33 PDT
When did it _start_ crashing? Can you identify a regression range?
Comment 8 Benjamin Stover (:stechz) 2011-07-14 13:25:04 PDT
I could spend time bisecting, but I think I'm getting close to the crash problem.

The /families/ parameter to the constructor for gfxFT2FontGroup has an invalid family name:
http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxFT2Fonts.cpp?force=1#363

/families/ contains only "serif", which gets put in the familyArray. However, when it comes to making that font, GetOrMakeFont returns null because there is no font with that name on my system.

That's where I am now. Let me know if any of this is giving you an "aha!" moment.
Comment 9 Benjamin Stover (:stechz) 2011-07-14 13:26:04 PDT
A follow up question: do we expect to continue supporting freetype2 on GTK Linux? Are we planning on ever deprecating it in favor of Pango?
Comment 10 Jonathan Kew (:jfkthame) 2011-07-14 13:37:04 PDT
(In reply to comment #8)

> /families/ contains only "serif", which gets put in the familyArray.
> However, when it comes to making that font, GetOrMakeFont returns null
> because there is no font with that name on my system.
> 
> That's where I am now. Let me know if any of this is giving you an "aha!"
> moment.

I'd guess this is a result of bug 668758 not handling this configuration properly. I'll try to look into it tomorrow if time permits (and if you don't get there first...)
Comment 11 Benjamin Stover (:stechz) 2011-07-14 13:52:43 PDT
OK, I think I'll leave it to the experts then, and just re-enable Pango. :)
Comment 12 Jonathan Kew (:jfkthame) 2011-07-16 06:19:29 PDT
Yes, confirmed this is a regression (specific to the --disable-pango configuration, and perhaps others that rely on gfxFT2Fonts+fontconfig) from bug 668758. The patch there eliminated a recursive call of gfxFontGroup::ForEachFontInternal as it didn't seem necessary for single font names from prefs, but that was incorrect in this particular case, as we rely on that recursive call to resolve fontconfig generics that are also CSS generics.
Comment 13 Jonathan Kew (:jfkthame) 2011-07-16 06:21:09 PDT
Created attachment 546315 [details] [diff] [review]
patch, restore the recursive application of ForEachFontInternal to font names from preferences

Note You need to log in before you can comment on or make changes to this bug.