Leaks GVariant's in multiple places

Bug #1104136 reported by Chris Coulson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libdbusmenu (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned
Quantal
Won't Fix
High
Unassigned

Bug Description

[Impact]

 * Affected applications with a high number of menu updates reach the maximum value allowed for the ID of a menuitem, and rejects further menu changes. Because the application underneath the menu has already removed the underlying actual GtkMenuItem objects, it is impossible to activate the items -- to effect the actions linked to the menuitems.
 * Some indicators have a relatively high and climbing memory usage due to the way they build menus to be displayed in the panel.

[Test Case]

 * Run nm-applet for a while (multiple days without shutdown, without killing the application), notice whether the menus are still usable.
 * Run indicators for a while, observe memory usage.

[Regression Potential]

Indicators with a very high amount of updates may be affected as circling back past the maximum value, if a new menu item is created with an ID still in use by a menuitem that has not been removed yet, neither or only one of the two menu items might be available to be clicked -- this could confuse users or cause error messages to be displayed.
Risk is low however since network-manager-gnome (nm-applet) is currently the application with the most menu updates.

[Other Info]
Dbusmenu seems to assume in multiple places that g_variant_parse() returns a floating reference. It doesn't, so these GVariant's are leaked.

It does things like:

  g_variant_builder_add_value(&builder, g_variant_parse(....));

  GVariant *variant = g_variant_parse(....);
  g_variant_ref_sink(variant);
  ...
  g_variant_unref(variant);

Both of these cases result in a leak

Related branches

Changed in libdbusmenu (Ubuntu):
importance: Undecided → High
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libdbusmenu - 12.10.2-0ubuntu2

---------------
libdbusmenu (12.10.2-0ubuntu2) raring; urgency=low

  * Backport trunk fixes from Mathieu Trudel-Lapierre and Chris Coulson
    - r438 "Remove uses of g_type_init" (lp: #1102471) for current glib
    - r439 "Fix a memory leak" (lp: #1103050)
    - r440 "Fix multiple leaks due to improper use of g_variant_parse()"
           (lp: #1104136)"
 -- Sebastien Bacher <email address hidden> Wed, 30 Jan 2013 12:10:31 +0100

Changed in libdbusmenu (Ubuntu):
status: In Progress → Fix Released
description: updated
Changed in libdbusmenu (Ubuntu Precise):
status: New → Triaged
Changed in libdbusmenu (Ubuntu Quantal):
status: New → Triaged
Changed in libdbusmenu (Ubuntu Precise):
importance: Undecided → Medium
importance: Medium → High
Changed in libdbusmenu (Ubuntu Quantal):
importance: Undecided → High
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Chris, or anyone else affected,

Accepted libdbusmenu into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libdbusmenu/0.6.2-0ubuntu0.2 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 add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and 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 libdbusmenu (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Scott Talbert (swt-techie) wrote :

@chrisccoulson any chance you can verify this bug (and also #1103050) is fixed in Precise so the SRU can be pushed out?

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I tested this with a build of Firefox with valgrind enabled, and it looks like it works properly

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libdbusmenu - 0.6.2-0ubuntu0.2

---------------
libdbusmenu (0.6.2-0ubuntu0.2) precise-proposed; urgency=low

  * debian/patches/lp1103050_method_invocation_leaks.patch: Leak in method call
    handlers for calls that don't require a reply (LP: #1103050)
  * debian/patches/lp1104136_variant_builder_leaks.patch: Leaks GVariant's in
    multiple places. (LP: #1104136)
  * debian/patches/lp1011073_menuitem_id_max.patch: increase maximum value for
    menuitem ID. (LP: #1011073)
 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 17 Jun 2013 15:06:03 -0400

Changed in libdbusmenu (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

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.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

quantal has seen the end of its life and is no longer receiving any updates. Marking the quantal task for this ticket as "Won't Fix".

Changed in libdbusmenu (Ubuntu Quantal):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.