Closed
Bug 686190
Opened 14 years ago
Closed 14 years ago
Crash [@ gfxFont::Draw]
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: jfkthame)
References
Details
(Keywords: crash, regression, testcase, Whiteboard: [sg:critical?])
Attachments
(4 files)
122 bytes,
text/html
|
Details | |
7.98 KB,
text/plain
|
Details | |
4.66 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
1.07 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
Might be the same as bug 685548, but this testcase crashes on a Mac, which should make it easier to debug.
Reporter | ||
Updated•14 years ago
|
Severity: normal → critical
Hardware: x86 → x86_64
Reporter | ||
Comment 1•14 years ago
|
||
Reporter | ||
Comment 2•14 years ago
|
||
Assignee | ||
Comment 3•14 years ago
|
||
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
Assignee | ||
Comment 4•14 years ago
|
||
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?
Assignee | ||
Updated•14 years ago
|
Attachment #559749 -
Flags: review? → review?(jdaggett)
Comment 5•14 years ago
|
||
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?
Assignee | ||
Comment 6•14 years ago
|
||
(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.
Updated•14 years ago
|
Attachment #559749 -
Flags: review?(jdaggett) → review+
Assignee | ||
Comment 8•14 years ago
|
||
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)
Assignee | ||
Comment 9•14 years ago
|
||
Whiteboard: [sg:critical?] → [sg:critical?] [inbound]
Updated•14 years ago
|
Attachment #559842 -
Flags: review?(jdaggett) → review+
Assignee | ||
Comment 11•14 years ago
|
||
Also pushed crashtest to -inbound:
http://hg.mozilla.org/integration/mozilla-inbound/rev/d3af41c6bf0b
Assignee | ||
Comment 12•14 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/91906f410681 (patch)
https://hg.mozilla.org/mozilla-central/rev/d3af41c6bf0b (crashtest)
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [sg:critical?] [inbound] → [sg:critical?]
![]() |
||
Updated•14 years ago
|
Flags: in-litmus?
Comment 13•14 years ago
|
||
There was a crashtest checked in for this bug, so no need for in-litmus.
Flags: in-testsuite+
Flags: in-litmus?
Flags: in-litmus-
Comment 14•14 years ago
|
||
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.
Updated•11 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•