Closed Bug 1316165 Opened 8 years ago Closed 8 years ago

reply_list/xcb_get_input_focus_reply_t leak from nsShmImage

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox50 --- disabled
firefox51 --- fixed
firefox52 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

Details

(Keywords: memory-leak, perf, regression)

Attachments

(2 files, 1 obsolete file)

The introduction of xcb_get_input_focus() in
https://hg.mozilla.org/mozilla-central/rev/ddcceb6bf9a6#l1.102 with the
xcb_get_input_focus_reply() in CreateDrawTarget() means that libxcb leaks the
replies in _xcb_in::replies whenever the nsShmImage is destroyed between Put()
and CreateDrawTarget(), which I assume is when destruction happens.

The leaks create a longer linked list for poll_for_reply() to search for every
subsequent reply that is freed.
Comment on attachment 8808822 [details]
bug 1316165 ensure xcb_get_input_focus_reply is called to avoid leaking the reply

https://reviewboard.mozilla.org/r/91550/#review91674
Attachment #8808822 - Flags: review?(lsalzman) → review+
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2635cff0413b
ensure xcb_get_input_focus_reply is called to avoid leaking the reply r=lsalzman
https://hg.mozilla.org/mozilla-central/rev/2635cff0413b
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment on attachment 8808822 [details]
bug 1316165 ensure xcb_get_input_focus_reply is called to avoid leaking the reply

Approval Request Comment
[Feature/regressing bug #]: bug 1287666
[User impact if declined]:
A small memory leak, but one that may affect performance as it accumulates over time.
[Describe test coverage new/current, TreeHerder]:
Leak testing doesn't catch this because there is still a pointer to the leaked objects.
[Risks and why]: 
Low risk because the patch is simple.
Tested locally, but this is disabled by default in Nightly with many systems.
Enabled by default on Aurora.
[String/UUID change made/needed]: None.
Attachment #8808822 - Flags: approval-mozilla-aurora?
Comment on attachment 8808822 [details]
bug 1316165 ensure xcb_get_input_focus_reply is called to avoid leaking the reply

Memory leak/perf fix, hooray, let's take it in 51 before the beta merge.
Attachment #8808822 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
This is hitting conflicts with bug 1314291. Either need a rebased patch or an uplift request there too.
Flags: needinfo?(karlt)
Attached patch aurora/51 patch (obsolete) — Splinter Review
This is what I pushed to Aurora.

Same thing, but xcb_request_check(mPutRequest), which removed on central, is
also moved with the xcb_get_input_focus_reply().  Because there is no reply to
the put, this part would only leak if there were an error, which is not
expected, but keeping this code together is also consistent.
Thanks, Ryan.  I should have thought about that.

Pushed
https://hg.mozilla.org/releases/mozilla-aurora/rev/1da2ad7a0924a22c90c71ca24c7d53a7ff9eb9b9
Flags: needinfo?(karlt)
Also needed to handle the early return should the put error:
https://hg.mozilla.org/releases/mozilla-aurora/rev/ec2757bbefb2134970ee18ff67ee43086a8ef4a0
Attachment #8810230 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: