Hang on Windows CE in gfxFontFamily::FindFontForStyle

VERIFIED FIXED

Status

()

--
blocker
VERIFIED FIXED
9 years ago
9 years ago

People

(Reporter: Dolske, Assigned: vlad)

Tracking

Trunk
ARM
Windows CE
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nv])

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
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.
(Reporter)

Updated

9 years ago
Whiteboard: [nv]
(Reporter)

Comment 1

9 years ago
Yes, confirmed, we're spinning in that loop. "i" starts a 4, goes down to 1, up to 9, down to 1, etc etc.
(Reporter)

Comment 2

9 years ago
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
Created attachment 391515 [details] [diff] [review]
fix

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 4

9 years ago
Comment on attachment 391515 [details] [diff] [review]
fix

bad craziness...  Looks fine.
Attachment #391515 - Flags: review?(jdaggett) → review+
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Comment 5

9 years ago
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.