Closed Bug 507037 Opened 15 years ago Closed 15 years ago

Hang on Windows CE in gfxFontFamily::FindFontForStyle

Categories

(Core :: Graphics, defect)

ARM
Windows CE
defect
Not set
blocker

Tracking

()

VERIFIED FIXED

People

(Reporter: Dolske, Assigned: vlad)

Details

(Whiteboard: [nv])

Attachments

(1 file)

When opening the Content pane in Tools -> Options, the browser will reliably hang on Windows CE. Not sure if this is due to a recent FF change, or the new Windows CE build I just installed.

Amazingly, the debugger is able to attach and break on the process, and seems to indicate we're spinning in the "for (PRInt8 i = baseWeight; ; i += direction)" loop. I'll do a little more debugging to confirm that's what is happening.
Whiteboard: [nv]
Yes, confirmed, we're spinning in that loop. "i" starts a 4, goes down to 1, up to 9, down to 1, etc etc.
In the call to FindWeightsForStyle() at the top, it has mFaces.Length() == 1, and sets matchesSomething on the second j-loop through ("Weight for entry i=0 is 0 (italic? 1)")

So this sets exactly one entry, weightList[0], but the loop we're stuck in only looks at weightList[1] thru weightList[9]. I'm not familiar with this code, so I'm not sure if the bug is that we should be matching more things, or if the loop should be checking weightList[0].
Severity: normal → blocker
Attached patch fixSplinter Review
The font that's causing this had a somewhat bogus OS2 font table weight -- "6" instead of "600".  This patch tries to be generous and handle 1..9 as valid weights (converting them to 100 .. 900), but I can also just as easily not do that and ignore the os2 table if something in the valid range isn't found.
Assignee: nobody → vladimir
Attachment #391515 - Flags: review?(jdaggett)
Comment on attachment 391515 [details] [diff] [review]
fix

bad craziness...  Looks fine.
Attachment #391515 - Flags: review?(jdaggett) → review+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Tried this a two dozen times, no hang; prefs window opens.  Verified fix on Mozilla/5.0 (Windows; U; WindowsCE 6.0; en-US; rv:1.9.2a2pre) Gecko/20090811 Firefox/3.6a2pre
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: