memory leak in label_notify_cb

Bug #785828 reported by JKL
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
DBus Menu
Fix Released
Undecided
Unassigned
0.4
Fix Released
Undecided
Unassigned
0.5
Fix Released
Undecided
Unassigned
libdbusmenu (Ubuntu)
Fix Released
Undecided
Unassigned
Natty
Fix Released
Undecided
Unassigned
Oneiric
Fix Released
Undecided
Unassigned

Bug Description

http://bazaar.launchpad.net/~dbusmenu-team/dbusmenu/trunk/view/head:/libdbusmenu-gtk/parser.c

Line 830:

g_object_get_property (G_OBJECT (widget), pspec->name, &prop_value);

According to the documentation, g_object_get property allocates memory that must be freed using g_value_unset().

http://www.gtk.org/api/2.6/gobject/gobject-The-Base-Object-Type.html#g-object-get-property

This never happens, causing a memory leak. Below is a valgrind log illustrating the problem. Note the line numbers are slightly different than the line numbers in trunk, but it seems clear what the problem is.

==4864== 790 bytes in 100 blocks are definitely lost in loss record 4,263 of 4,374
==4864== at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
==4864== by 0x77D4A62: g_malloc (gmem.c:164)
==4864== by 0x77ED06D: g_strdup (gstrfuncs.c:102)
==4864== by 0x6F6313F: g_value_set_string (gvaluetypes.c:999)
==4864== by 0x6F3F26B: g_object_get_property (gobject.c:1131)
==4864== by 0xB36AA25: label_notify_cb (parser.c:837)

...rest of trace omitted

Related branches

Ted Gould (ted)
Changed in dbusmenu:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

This is fixed in oneiric's libdbusmenu, which has 0.4.90.

Changed in libdbusmenu (Ubuntu Oneiric):
status: New → Fix Released
Revision history for this message
Michael Hofmann (mh21) wrote :

Test case:
- get indicator-multiload from: https://launchpad.net/~indicator-multiload/+archive/daily/+sourcepub/1880139/+listing-archive-extra
- launch it from Applications->System Tools->System Load Indicator
- indicator->preferences->refresh interval to 50ms
- quit the indicator (important!)
- launch it again from Applications->System Tools->System Load Indicator
- monitor its memory use with "watch 'ps aux|grep multiload$'"

- with ubuntu3: increase in memory use of 8kB/2s
- with ubuntu4: no increase in memory use

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Michael! This package explicitly has format 1.0 and already has inline patches, so inline patching is fine for this SRU.

Sponsored with corrected upload target, subscribed ubuntu-sru.

Changed in libdbusmenu (Ubuntu Natty):
status: New → Fix Committed
Revision history for this message
Chris Halse Rogers (raof) wrote :

Hm. You've got a stray libdbusmenu-0.4.3/debian/debhelper.log file in the upload. I'm not sure why dh_clean didn't get rid of it, but it should be removed and the package reuploaded. Thanks!

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 785828] Re: memory leak in label_notify_cb

Chris Halse Rogers [2011-08-24 6:10 -0000]:
> Hm. You've got a stray libdbusmenu-0.4.3/debian/debhelper.log file in
> the upload. I'm not sure why dh_clean didn't get rid of it, but it
> should be removed and the package reuploaded. Thanks!

Chris, the previous package had even more debhelper goo, it's just an
additional line. It might be a debhelper bug, or a bug in the
packaging (although debian/rules is fairly simple), but I did not want
to turn the packaging upside down in an SRU.

Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)

Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello JKL, or anyone else affected,

Accepted libdbusmenu into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Michael Hofmann (mh21) wrote :

Sorry for the delay, 0.4.3-0ubuntu4 from -proposed solves the problem for me, no other problems after more than a week of testing.

Omer Akram (om26er)
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.4.3-0ubuntu4

---------------
libdbusmenu (0.4.3-0ubuntu4) natty-proposed; urgency=low

  * Backport bug fixes from trunk:
    - Fix memory leak in label_notify_cb (LP: #785828)
 -- Michael Hofmann <email address hidden> Wed, 17 Aug 2011 10:42:58 +0200

Changed in libdbusmenu (Ubuntu Natty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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