Closed Bug 686190 Opened 14 years ago Closed 14 years ago

Crash [@ gfxFont::Draw]

Categories

(Core :: Graphics, defect)

x86_64
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: jfkthame)

References

Details

(Keywords: crash, regression, testcase, Whiteboard: [sg:critical?])

Attachments

(4 files)

Might be the same as bug 685548, but this testcase crashes on a Mac, which should make it easier to debug.
Severity: normal → critical
Hardware: x86 → x86_64
Attached file stack trace
Thanks for the testcase. I understand why this is crashing, and will try to work up a patch shortly. It's a regression from bug 674909. Bug 685548 is very likely the same, but I haven't specifically confirmed this yet.
Blocks: 674909
Keywords: regression
There was an assumption in GlyphBuffer::Flush that no more than two glyphs would be appended between Flush() calls. With the enhanced synthetic-bold implementation, this broke because synthetic bold on large font sizes does "multi-strike" with additional copies of the glyph. So the testcase crashes because (on a default OS X configuration) the Korean character resolves to a font that doesn't have a bold face, so synthetic bold gets used; and at such a huge size (due to font-size-adjust), the number of multistrike glyphs causes a buffer overflow, corrupting mNumGlyphs and whatever follows on the stack. A simple solution is to ensure that Flush() is called for every added glyph, by calling it within the synthetic bold multi-strike loop. (We should also add the testcase as a crashtest - actually, by using an @font-face rule we can ensure that synthetic bold will definitely be used, independent of the OS font collection and prefs. I'll adapt it accordingly.)
Assignee: nobody → jfkthame
Attachment #559749 - Flags: review?
Attachment #559749 - Flags: review? → review?(jdaggett)
Why do the Flush within the do..while loops in the if (synthetic) blocks? Seems like you could just a well do that at the end of the loop, no?
(In reply to John Daggett (:jtd) from comment #5) > Why do the Flush within the do..while loops in the if (synthetic) blocks? > Seems like you could just a well do that at the end of the loop, no? But the GlyphBuffer might reach the "full" mark on one of the intermediate iterations, in the case where we're doing a number of strikes.
Attachment #559749 - Flags: review?(jdaggett) → review+
Attached patch crashtestSplinter Review
Simplified testcase that triggers this crash on OS X (and presumably Android, and any other platform that uses our multi-strike synthetic bolding rather than relying on platform API support for it). This uses @font-face to avoid being dependent on the local system's font configuration.
Attachment #559842 - Flags: review?(jdaggett)
Whiteboard: [sg:critical?] → [sg:critical?] [inbound]
Attachment #559842 - Flags: review?(jdaggett) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [sg:critical?] [inbound] → [sg:critical?]
There was a crashtest checked in for this bug, so no need for in-litmus.
Flags: in-testsuite+
Flags: in-litmus?
Flags: in-litmus-
Clang warns about this expression: if (!aFinish && mNumGlyphs < GLYPH_BUFFER_SIZE || !mNumGlyphs) { where it's not clear if it should be: if ((!aFinish && mNumGlyphs < GLYPH_BUFFER_SIZE) || !mNumGlyphs) { or: if (!aFinish && (mNumGlyphs < GLYPH_BUFFER_SIZE || !mNumGlyphs)) { can you add the parenthesis to make it clear which one you mean.
Group: core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: