Closed Bug 1364627 Opened 7 years ago Closed 7 years ago

NativeFontResourceFontconfig leak when using DrawTargetRecording on Linux

Categories

(Core :: Graphics, defect, P1)

53 Branch
All
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox-esr45 --- unaffected
firefox-esr52 --- unaffected
firefox53 --- wontfix
firefox54 --- fixed
firefox55 --- fixed

People

(Reporter: jrmuizel, Assigned: lsalzman)

References

Details

(Keywords: regression, Whiteboard: [gfx-noted][tor 23970])

Attachments

(2 files)

Blocks: 1362115
Priority: -- → P2
Whiteboard: [gfx-noted]
The issue here is that the Cairo scaled font passed to the ScaledFontFontconfig constructor then gets ref'd by cairo_scaled_font_reference inside ScaledFontBase. ScaledFontBase is thus expecting that something else either owned the Cairo scaled font or was going to release the reference to fully hand it off to it if that was the intention.

Thus, we need to to unref (via cairo_scaled_font_destroy) after we pass it in to the constructor. We weren't doing this, so the Cairo scaled fonts never got destroyed, and all bad stuff followed from this.

I'm not sure whether or not to consider this a "regression", since while this was introduced in bug 1309205, we never even supported font recording at all prior to that bug. None the less, this affects versions 53+ when using print-via-parent on Linux, so uplifting this fix is probably a good thing to not leak memory during printing.
Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Attachment #8872863 - Flags: review?(jmuizelaar)
Blocks: 1309205
Has Regression Range: --- → yes
Has STR: --- → yes
Component: Graphics: WebRender → Graphics
Keywords: regression
OS: Unspecified → Linux
Priority: P2 → P1
Hardware: Unspecified → All
Version: unspecified → 53 Branch
Summary: NativeFontResourceFontconfig leak when running with WebRender/BlobImage → NativeFontResourceFontconfig leak when using DrawTargetRecording on Linux
Attachment #8872863 - Flags: review?(jmuizelaar) → review+
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5e7872cb3b5c
fix leaking of Cairo scaled font when creating ScaledFontFontconfig from a recording. r=jrmuizel
https://hg.mozilla.org/mozilla-central/rev/5e7872cb3b5c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Please request Beta approval on this at your earliest convenience. The RC build is happening on Monday.
Flags: needinfo?(lsalzman)
Just a rebased version of the patch for 54, since the surrounding code changed a little bit.

Approval Request Comment
[Feature/Bug causing the regression]: bug 1309205
[User impact if declined]: Memory leaks when printing on Linux with E10s.
[Is this code covered by automated tests?]: Currently printing is not covered by automated testing, which was why this leak managed to sneak in. Tobias Schneider is currently working on fixing that scenario.
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no 
[List of other uplifts needed for the feature/fix]:
[Is the change risky?]: no
[Why is the change risky/not risky?]: Just a simple one line fix to free a Cairo font that should have been freed, which gets rid of the leak.
[String changes made/needed]: none
Flags: needinfo?(lsalzman)
Attachment #8873261 - Flags: review+
Attachment #8873261 - Flags: approval-mozilla-beta?
Comment on attachment 8873261 [details] [diff] [review]
fix leaking of Cairo scaled font when creating ScaledFontFontconfig from a recording (54)

Seems like a low risk fix for a memleak issue, Beta54+
Attachment #8873261 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
(In reply to Lee Salzman [:lsalzman] from comment #5)
> [Is this code covered by automated tests?]: Currently printing is not
> covered by automated testing, which was why this leak managed to sneak in.
> Tobias Schneider is currently working on fixing that scenario.
> [Has the fix been verified in Nightly?]: yes
> [Needs manual test from QE? If yes, steps to reproduce]: no 

Setting qe-verify- based on Lee's assessment on manual testing needs.
Flags: qe-verify-
Whiteboard: [gfx-noted] → [gfx-noted][tor 23970]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: