gtk-window-decorator leaks large numbers of pixmaps and pixmap memory

Bug #1057263 reported by Daniel van Vugt on 2012-09-27
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Compiz
High
Daniel van Vugt
Compiz Core
High
Daniel van Vugt
compiz (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned

Bug Description

[Impact]

Memory leak when resizing window in normal mode.

[Test Case]

Test case:
1. Install xrestop (sudo apt-get install xrestop)
2. Run xrestop and look for the gtk-window-decorator row
3. Note the values for "Pxms" and "Pxm mem".
4. Resize a window rapidly (make sure you have Normal resize mode, not Rectangle)

Expected: No significant change in Pxm metrics.
Observed: Hundreds of pixmaps leaked and Pxm mem grows by several megabytes per second.

[Regression Potential]

Low, used in Ubuntu 12.10 as well without regressions.

Related branches

Changed in compiz-core:
status: New → Triaged
importance: Undecided → High
milestone: none → 0.9.7.10
description: updated
Daniel van Vugt (vanvugt) wrote :

I've isolated the problem to "destroyed_pixmaps_table" in gtk/window-decorator/

If I replace the g_hash_table_insert with g_object_unref then the leak doesn't happen. But I suspect that's not logically the right solution.

Changed in compiz:
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in compiz:
status: Triaged → In Progress
Changed in compiz:
status: In Progress → Fix Committed
Daniel van Vugt (vanvugt) wrote :

Fix committed into lp:compiz at revision 3401

Changed in compiz:
status: Fix Committed → Fix Released
Daniel van Vugt (vanvugt) wrote :

Fix committed to lp:compiz-core/0.9.7 at revision 3119.

Changed in compiz-core:
status: Triaged → Fix Committed
assignee: nobody → Daniel van Vugt (vanvugt)
description: updated
description: updated
Didier Roche (didrocks) on 2012-11-16
Changed in compiz (Ubuntu):
status: New → Fix Released
Changed in compiz (Ubuntu Precise):
status: New → In Progress
Changed in compiz-core:
status: Fix Committed → Fix Released

Hello Daniel, or anyone else affected,

Accepted compiz into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/compiz/1:0.9.7.8+bzr3121-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in compiz (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Timo Jyrinki (timo-jyrinki) wrote :

Seems fixed.

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package compiz - 1:0.9.7.8+bzr3121-0ubuntu1

---------------
compiz (1:0.9.7.8+bzr3121-0ubuntu1) precise-proposed; urgency=low

  * New upstream stable branch snapshot.
    - Includes all the previous cherry-picked fixes
    - Fix crash when imgsvg is loaded, due to missing symbol
      (decor_apply_gravity from libdecoration). (LP: #956986)
    - Fix multiple window placement bugs (LP: #974242) (LP: #976032)
    - Fix window handle leak causing gradual degradation in desktop
      performance (LP: #1050610)
    - Some decoration pixmaps get leaked on window resize, due to race
      conditions between gtk-window-decorator and the decor plugin.
      (LP: #1057263)
    - Avoid a NULL dereference and give a useful error message instead.
      (LP: #944653)
    - Fix leakage of destroyed_pixmaps_table, containing pointers to freed
      decor_t's which could result in a freed GHashTable being passed into
      g_hash_table_remove and causing a crash. (LP: #1060171)
  * debian/patches/compiz-package-gles2.patch:
    - Drop the NEWS file, update decor.cpp part to build with new upstream
      code.
  * debian/patches/revert_fix_933776_955035.patch:
    - Cherry-pick the revert from upstream since the bug fix is not
      suitable for SRU as is
  * debian/patches/revert_fix_994841.patch:
    - Cherry-pick also this revert as non-SRU material, not relevant
      to users
  * debian/libdecoration0.symbols:
    - Update with latest symbols
 -- Timo Jyrinki <email address hidden> Mon, 12 Nov 2012 13:56:29 +0200

Changed in compiz (Ubuntu Precise):
status: Fix Committed → Fix Released
positivek (anonyhole) wrote :

The bug still exists in 14.04.1 LTS:

Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

Below is a copy of my "xrestop" including the gtk-window-decorator. The "Pxms" counter would increase by about 6 each time I alt-Tab back and forth to another window. The "Pxm mem" would also increase. Neither over level off or decrease. So, this bug still exists and the leak makes me have to close my session every day or two. I'm running out of what should be plentiful memory.

xrestop - Display: localhost
          Monitoring 44 clients. XErrors: 2
          Pixmaps: 556734K total, Other: 288K total, All: 557023K total

res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
2000000 33 65 1 4193 429 481002K 13K 481015K 2423 gtk-window-decorator
2400000 477 3 1 68 9125 43639K 226K 43865K ? Compiz

...

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers