Closed Bug 416232 Opened 13 years ago Closed 13 years ago

Firefox and Thunderbird hang on startup [@ ReadLocalizedNames]

Categories

(Core :: Graphics, defect, P1)

x86
macOS
defect

Tracking

()

VERIFIED FIXED
mozilla1.9beta4

People

(Reporter: whimboo, Assigned: jtd)

References

Details

(Keywords: hang)

Attachments

(2 files)

With the latest nightly builds Firefox hangs on startup. I never reach or have to wait a really long time at least, to see the profile manager. I did a test with my debug build with following results:

#0  0x9022d6e7 in FOFindFontObjectFromID ()
#1  0x91743727 in ATSUGetIndFontName ()
#2  0x14cbe5e1 in ReadLocalizedNames (familyName=0x35d25ce0, faceArray=0x35d6b5d0, faceIndex=0, localizedNames=0x35d42200) at /Users/henrik/Projects/mozilla/source/mozilla/gfx/thebes/src/gfxQuartzFontCache.mm:491
#3  0x14cbf7fa in gfxQuartzFontCache::InitFontList (this=0x35d25000) at /Users/henrik/Projects/mozilla/source/mozilla/gfx/thebes/src/gfxQuartzFontCache.mm:595
#4  0x14cbfa45 in gfxQuartzFontCache::gfxQuartzFontCache (this=0x35d25000) at /Users/henrik/Projects/mozilla/source/mozilla/gfx/thebes/src/gfxQuartzFontCache.mm:414
#5  0x14d2d46b in gfxQuartzFontCache::Init () at /Users/henrik/Projects/mozilla/source/mozilla/gfx/thebes/src/gfxQuartzFontCache.h:155
#6  0x14cb4124 in gfxPlatform::Init () at /Users/henrik/Projects/mozilla/source/mozilla/gfx/thebes/src/gfxPlatform.cpp:139
#7  0x14aa444b in nsThebesGfxModuleCtor (self=0x291ea30) at /Users/henrik/Projects/mozilla/source/mozilla/gfx/src/thebes/nsThebesGfxFactory.cpp:143
#8  0x0132147c in nsGenericModule::Initialize (this=0x291ea30, compMgr=0x2916800) at nsGenericFactory.cpp:273
#9  0x01321695 in nsGenericModule::GetClassObject (this=0x291ea30, aCompMgr=0x2916800, aClass=@0x202dab8, aIID=@0x13ea1b0, r_classObj=0x202dad0) at nsGenericFactory.cpp:361
#10 0x013709d8 in nsFactoryEntry::GetFactory (this=0x202dab8, aFactory=0xbfffe3d0) at /Users/henrik/Projects/mozilla/source/mozilla/xpcom/components/nsComponentManager.cpp:3494
#11 0x01370cf3 in nsComponentManagerImpl::CreateInstance (this=0x2916800, aClass=@0x33de526c, aDelegate=0x0, aIID=@0x33de4b24, aResult=0x35d24524) at /Users/henrik/Projects/mozilla/source/mozilla/xpcom/components/nsComponentManager.cpp:1611
#12 0x01316b99 in CallCreateInstance (aCID=@0x33de526c, aDelegate=0x0, aIID=@0x33de4b24, aResult=0x35d24524) at nsComponentManagerUtils.cpp:157
#13 0x33ddd054 in CallCreateInstance<nsIDeviceContext> (aClass=@0x33de526c, aDestination=0x35d24524) at ../../../dist/include/xpcom/nsComponentManagerUtils.h:250
#14 0x33daef30 in nsBaseWidget::BaseCreate (this=0x35d24500, aParent=0x0, aRect=@0xbfffe720, aHandleEventFunction=0x2ff2bffe <nsWebShellWindow::HandleEvent(nsGUIEvent*)>, aContext=0x0, aAppShell=0x2936bb0, aToolkit=0x0, aInitData=0xbfffe7f8) at /Users/henrik/Projects/mozilla/source/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp:202
#15 0x33d8ed78 in nsCocoaWindow::StandardCreate (this=0x35d24500, aParent=0x0, aRect=@0xbfffe720, aHandleEventFunction=0x2ff2bffe <nsWebShellWindow::HandleEvent(nsGUIEvent*)>, aContext=0x0, aAppShell=0x2936bb0, aToolkit=0x0, aInitData=0xbfffe7f8, aNativeWindow=0x0) at /Users/henrik/Projects/mozilla/source/mozilla/widget/src/cocoa/nsCocoaWindow.mm:211
#16 0x33d8c031 in nsCocoaWindow::Create (this=0x35d24500, aParent=0x0, aRect=@0xbfffe720, aHandleEventFunction=0x2ff2bffe <nsWebShellWindow::HandleEvent(nsGUIEvent*)>, aContext=0x0, aAppShell=0x2936bb0, aToolkit=0x0, aInitData=0xbfffe7f8) at /Users/henrik/Projects/mozilla/source/mozilla/widget/src/cocoa/nsCocoaWindow.mm:443
#17 0x2ff2a4ee in nsWebShellWindow::Initialize (this=0x35d243e0, aParent=0x0, aShell=0x2936bb0, aUrl=0x0, aInitialWidth=1, aInitialHeight=1, aIsHiddenWindow=0, widgetInitData=@0xbfffe7f8) at /Users/henrik/Projects/mozilla/source/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp:198
#18 0x2ff265b5 in nsAppShellService::JustCreateTopWindow (this=0x35d23e20, aParent=0x0, aUrl=0x0, aChromeMask=4160750598, aInitialWidth=1, aInitialHeight=1, aIsHiddenWindow=0, aAppShell=0x2936bb0, aResult=0xbfffe878) at /Users/henrik/Projects/mozilla/source/mozilla/xpfe/appshell/src/nsAppShellService.cpp:361
#19 0x2ff2673e in nsAppShellService::CreateTopLevelWindow (this=0x35d23e20, aParent=0x0, aUrl=0x0, aChromeMask=4160750598, aInitialWidth=-1, aInitialHeight=-1, aAppShell=0x2936bb0, aResult=0xbfffe8e0) at /Users/henrik/Projects/mozilla/source/mozilla/xpfe/appshell/src/nsAppShellService.cpp:235
#20 0x3301c420 in nsAppStartup::CreateChromeWindow2 (this=0x29435b0, aParent=0x0, aChromeFlags=4160750598, aContextFlags=0, aURI=0x35d24040, aCancel=0xbfffeb94, _retval=0xbfffeba0) at /Users/henrik/Projects/mozilla/source/mozilla/toolkit/components/startup/src/nsAppStartup.cpp:467
#21 0x1439b0aa in nsWindowWatcher::OpenWindowJSInternal (this=0x35d1e570, aParent=0x0, aUrl=0x2447d0 "chrome://mozapps/content/profile/profileSelection.xul", aName=0x2453b4 "_blank", aFeatures=0x245390 "centerscreen,chrome,modal,titlebar", aDialog=1, argv=0x35d23ee0, aCalledFromJS=0, _retval=0xbfffeee4) at /Users/henrik/Projects/mozilla/source/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp:677
#22 0x1439cc29 in nsWindowWatcher::OpenWindow (this=0x35d1e570, aParent=0x0, aUrl=0x2447d0 "chrome://mozapps/content/profile/profileSelection.xul", aName=0x2453b4 "_blank", aFeatures=0x245390 "centerscreen,chrome,modal,titlebar", aArguments=0x35d23db0, _retval=0xbfffeee4) at /Users/henrik/Projects/mozilla/source/mozilla/embedding/components/windowwatcher/src/nsWindowWatcher.cpp:419
#23 0x0020a07d in ShowProfileManager (aProfileSvc=0x2914f20, aNative=0x2914e20) at /Users/henrik/Projects/mozilla/source/mozilla/toolkit/xre/nsAppRunner.cpp:1728
#24 0x0020c7b2 in SelectProfile (aResult=0xbffff524, aNative=0x2914e20, aStartOffline=0xbffff520, aProfileName=0xbffff3d0) at /Users/henrik/Projects/mozilla/source/mozilla/toolkit/xre/nsAppRunner.cpp:2056
#25 0x0020f67b in XRE_main (argc=1, argv=0xbffff820, aAppData=0x290b340) at /Users/henrik/Projects/mozilla/source/mozilla/toolkit/xre/nsAppRunner.cpp:2859
#26 0x00002798 in main (argc=1, argv=0xbffff820) at /Users/henrik/Projects/mozilla/source/mozilla/browser/app/nsBrowserApp.cpp:158

The hang is within the loop here:
#2  0x14cbe5e1 in ReadLocalizedNames (familyName=0x35d25ce0, faceArray=0x35d6b5d0, faceIndex=0, localizedNames=0x35d42200) at /Users/henrik/Projects/mozilla/source/mozilla/gfx/thebes/src/gfxQuartzFontCache.mm:491
491	in /Users/henrik/Projects/mozilla/source/mozilla/gfx/thebes/src/gfxQuartzFontCache.mm

(gdb) p nameCount
$1 = 2457881797
(gdb) p i
$2 = 277791991
(gdb) p err
$3 = -8796

and err means: [kATSUInvalidFontErr]
Flags: blocking1.9?
Same applies to latest Thunderbird nightly builds. You have to be very patience.
Summary: Firefox hangs on startup in ReadLocalizedNames → Firefox and Thunderbird hang on startup [@ ReadLocalizedNames]
John this is likely you...
Assignee: nobody → jdaggett
Flags: blocking1.9? → blocking1.9+
Priority: -- → P1
Strangely this isn't visible anymore today. I didn't updated Minefield. The only thing I did was putting my MacBook into Sleep and wake it up again. No idea what causes this hang. But anyway it seems that an error condition isn't correctly handled.
(In reply to comment #3)
> Strangely this isn't visible anymore today. I didn't updated Minefield. The
> only thing I did was putting my MacBook into Sleep and wake it up again. No
> idea what causes this hang. But anyway it seems that an error condition isn't
> correctly handled.

So this happened once with both Firefox and Thunderbird but now it's not reproducible?  If possible, could you attach a list of fonts on your system?

/Library/Fonts
/System/Library/Fonts
~/Library/Fonts

Is it possible you have any Type 1 fonts around?  Or that you use Font Book to enable/disable specific fonts?  I'm just wondering how to reproduce this.

Looks like I didn't check for an error coming back from the call to ATSUCountFontNames or the call to the private NSFont method [font _atsFontID], I'll set up a patch for this:

http://lxr.mozilla.org/mozilla/source/gfx/thebes/src/gfxQuartzFontCache.mm#480



Attached file List of fonts
Here is the list of my fonts. They didn't changed between the hang and a day after. Currently I'm still unable to reproduce this issue. No idea what's the reason. The only thing I can remember is that I switched the OS language some days ago back to German after I was running English for a week. But no idea if this is related here.
Check for errors coming back from ATSU name table calls.  Also, change the name of ReadLocalizedNames to ReadOtherFamilyNames, since that's a better description of what it's actually doing.
Attachment #302769 - Flags: superreview?(roc)
Attachment #302769 - Flags: review?(roc)
Attachment #302769 - Flags: superreview?(roc)
Attachment #302769 - Flags: superreview+
Attachment #302769 - Flags: review?(roc)
Attachment #302769 - Flags: review+
checked in
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
I was able to reproduce this hang with a build before the patch was checked-in. It seems that it really happened when switching the preferred language for an user account. In my case I switched from German to English. After that I had to re-login to get the new language applied. Now Minefield hangs on start.

I will have a closer look at it later today and if I can verify the fix. 
Flags: in-litmus?
Target Milestone: --- → mozilla1.9beta4
Verified with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b4pre) Gecko/2008021204 Minefield/3.0b4pre ID:2008021204
Status: RESOLVED → VERIFIED
Duplicate of this bug: 418093
Duplicate of this bug: 418093
You need to log in before you can comment on or make changes to this bug.