Closed Bug 465560 Opened 16 years ago Closed 15 years ago

Crash [@ nsThebesFontMetrics::GetHeight] with --disable-pango

Categories

(Core :: Graphics, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 462908

People

(Reporter: blassey, Assigned: blassey)

Details

Attachments

(1 file, 1 obsolete file)

Note: this build has attachment 348788 [details] [diff] [review] from bug 465554 applied.

backtrace:
#0  0xb7ee67f2 in ?? () from /lib/ld-linux.so.2
#1  0xb7c0fcb6 in nanosleep () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7c0fac7 in sleep () from /lib/tls/i686/cmov/libc.so.6
#3  0xb5c8c7c3 in ah_crap_handler (signum=11) at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/toolkit/xre/nsSigHandlers.cpp:149
#4  0xb5c8da8a in nsProfileLock::FatalSignalHandler (signo=11) at nsProfileLock.cpp:216
#5  <signal handler called>
#6  0x00000000 in ?? ()
#7  0xb6b98769 in nsThebesFontMetrics::GetHeight (this=0xb234a9c0, aHeight=@0xbff97e5c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/gfx/src/thebes/nsThebesFontMetrics.cpp:173
#8  0xb620584d in nsTextBoxFrame::GetTextSize (this=0xb17931c8, aPresContext=0xb23dc400, aRenderingContext=@0xb17c40c0, aString=@0xb17931fc,
    aSize=@0xbff97e58, aAscent=@0xb1793234)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsTextBoxFrame.cpp:968
#9  0xb620594a in nsTextBoxFrame::CalcTextSize (this=0xb17931c8, aBoxLayoutState=@0xbff9860c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsTextBoxFrame.cpp:985
#10 0xb620597a in nsTextBoxFrame::GetBoxAscent (this=0xb17931c8, aBoxLayoutState=@0xbff9860c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsTextBoxFrame.cpp:1065
#11 0xb61ede30 in nsSprocketLayout::GetAscent (this=0xb36268b0, aBox=0xb178bf98, aState=@0xbff9860c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsSprocketLayout.cpp:1525
#12 0xb61ebe89 in nsBoxFrame::GetBoxAscent (this=0xb178bf98, aBoxLayoutState=@0xbff9860c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsBoxFrame.cpp:840
#13 0xb61ede30 in nsSprocketLayout::GetAscent (this=0xb36268b0, aBox=0xb178bed4, aState=@0xbff9860c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsSprocketLayout.cpp:1525
#14 0xb61ebe89 in nsBoxFrame::GetBoxAscent (this=0xb178bed4, aBoxLayoutState=@0xbff9860c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsBoxFrame.cpp:840
#15 0xb61ede30 in nsSprocketLayout::GetAscent (this=0xb36268b0, aBox=0xb178bdec, aState=@0xbff9860c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsSprocketLayout.cpp:1525
#16 0xb61ebe89 in nsBoxFrame::GetBoxAscent (this=0xb178bdec, aBoxLayoutState=@0xbff9860c)
    at /scratchbox/users/blassey/home/blassey/clean/mozilla-central/layout/xul/base/src/nsBoxFrame.cpp:840
#17 0xb61ede30 in nsSprocketLayout::GetAscent (this=0xb36268b0, aBox=0xb178b88c, aState=@0xbff9860c)
The root cause seems to be that mFontGroup->mFonts is empty.  We're not finding any fonts in the constructor (gfxFT2FontGroup.cpp:219)
Is there a better way to get the system's default font than hard coding it?
Assignee: nobody → blassey
Attachment #348838 - Flags: review?(pavlov)
(In reply to comment #2)
> Is there a better way to get the system's default font than hard coding it?

"Sans" is not a physical font but an alias that is resolved in a language-specific manner.

gfxPlatformGtk::ResolveFontName("sans-serif", ...) should provide a family name.
So I expect

 ForEachFont("sans-serif", aStyle->langGroup, FontCallback, &familyArray)

should do what you want, but I don't know why the similar call for prefFamilies is not finding anything.

Is familyArray empty?
If so, it may be worth debugging gfxPlatformGtk::ResolveFontName.

Even assuming a good family name is found, there is always the chance that the font gets removed after the family name is cached, so avoiding a crash on failure to open the font is still necessary.  Do the null and length checks in attachment 347930 [details] [diff] [review] avoid the crash?
Attachment #348838 - Attachment is obsolete: true
Attachment #349069 - Flags: review?(pavlov)
Attachment #348838 - Flags: review?(pavlov)
familyArray is empty.  There may be a problem with ResolveFontName, but I think its reasonable for it not to find a font. Given that, there should be a fallback because creating a fontgroup with out any fonts will lead to a crash.

I'm building with the windows freetype patch applied and we still crash.  I had to remove the nullMetrics bit because gcc didn't like it.  It looks like that may actually avoid this crash as well if we can get it to compile for linux.
This was fixed in bug 462908
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Attachment #349069 - Flags: review?(pavlov)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: