Closed Bug 838617 Opened 12 years ago Closed 12 years ago

assertion at cairo-win32-font.c:2112 is frequently being triggered - code inspection indicates use of uninitialized object

Categories

(Core :: Graphics, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 file)

Running a current debug build on XP or on Win7 without acceleration (i.e., using GDI fonts), I'm seeing the assertion at: http://mxr.mozilla.org/mozilla-central/source/gfx/cairo/cairo/src/cairo-win32-font.c#2112 being hit pretty frequently, which seemed worrying. The same assertion is showing up in TBPL logs, e.g.: https://tbpl.mozilla.org/php/getParsedLog.php?id=19485509&tree=Firefox&full=1 but (unfortunately) it isn't picked up by the log parser, so the runs still show up as green. This assertion (and a bunch of the surrounding code) was added in bug 717178. Inspection of the code here shows that whenever cairo_win32_font_face_create_for_logfontw_hfont is called with a non-null HFONT parameter, the |key| variable is never initialized, as the only call that would set it is within the first |if (!font) {...}| block. So the assertion is comparing the font_face's hash against a chunk of uninitialized memory.
If I'm understanding the code here correctly, I think all that's needed is to move the assertion inside the following if() block, as in the case where a non-null HFONT was passed, we aren't interested in the hash table anyway.
Attachment #710709 - Flags: review?(roc)
Assignee: nobody → jfkthame
Comment on attachment 710709 [details] [diff] [review] don't assert equality with the key's hash unless it was actually initialized Review of attachment 710709 [details] [diff] [review]: ----------------------------------------------------------------- don't forget to create a patch in gfx/cairo for this
Attachment #710709 - Flags: review?(roc) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/abea8a82da63 (including adding the patch file to gfx/cairo)
Target Milestone: --- → mozilla21
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
No longer blocks: 900934
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: