15 years ago
6 years ago


(Reporter: blizzard, Assigned: blizzard)



Firefox Tracking Flags

(Not tracked)



(1 attachment)



15 years ago
Mail from dbaron:

The leak tools are showing a lot of leaks from a single stack:

FcPatternCreate[/usr/lib/ +0x14763]
FcFontRenderPrepare[/usr/lib/ +0x12BA9]

In both these places, we pass ownership of this pattern to the font
through XftFontOpenPattern.  Looking at xftfreetype.c in the source RPM,
it seems like this function is designed to take ownership of the pattern
since it calls FcPatternDestroy on the argument in a case where it
doesn't need the pattern.  However, I can't find the code in the normal
case that destroys the pattern when destroying the font.  Does this seem
like an Xft bug to you?
I believe this is unrelated to , but I'll mention it
here anyway.

keithp, any thoughts on whether this is a real bug?

Comment 2

15 years ago
Sure looks like I goofed on this one.  Both the pattern and the charset are
never freed (note that the charset is generally shared with the cached font
info, so that's not noticed as a leak).

This problem is mitigated by the sharing of identical fonts and the caching of
recently closed fonts; in both of those cases the pattern is correctly freed.

I'll build a test infrastructure and see if I can't verify the bug and then add
the obvious fix.

Comment 3

15 years ago
Please do.  I'll try to get it into Red Hat's upstream sources.
Created attachment 111972 [details] [diff] [review]
patch to xftfreetype.c

This patch fixes the leaks for me.

I never actually observed the charset leak, but that looks like it also leaks
(in the case where it calls FcFreeTypeCharSet, which seems like it might be an
edge case) since FcFreeTypeCharSet returns the result of FcCharSetCreate.

I've been running with this for about 10 minutes so far, but I'll continue to
run with it.

Keith, does this patch seem right?  (Or did you already patch it?  I don't see
a fix in


Comment 5

15 years ago
Yes, the patch looks right.  I'm a bit surprised that you're hitting it as it
should only occur for fonts which aren't found in the fontconfig cache.

I'm afraid I won't get a chance to apply this patch for a couple of weeks as it
will require some regression testing.
keithp: Any progress on looking at this patch?

Comment 7

15 years ago
Thanks for the reminder.  I've committed a fixed version of the provided patch
to Xft CVS (at  I also found a leak in fontconfig at the
same time and fixed that too.
This appears to have been a bug not actually in Mozilla but in fontconfig, and to have been fixed many years ago.  And I'm not sure what it was doing in the XUL component.
Last Resolved: 6 years ago
Component: XUL → Graphics
QA Contact: jrgmorrison → thebes
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.