Small memory leak

Bug #953970 reported by Hernando Torque
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Application Indicators
Invalid
Medium
Charles Kerr
indicator-application (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Valgrind shows a small memory leak (the last "definitely lost" one not reported):

==9997== 555 (40 direct, 515 indirect) bytes in 1 blocks are definitely lost in loss record 1,774 of 1,837
==9997== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9997== by 0x5A6EBC8: g_malloc (gmem.c:159)
==9997== by 0x5A818B2: g_slice_alloc (gslice.c:1003)
==9997== by 0x5A9B9F9: g_variant_alloc (gvariant-core.c:476)
==9997== by 0x5A9BB5C: g_variant_new_from_children (gvariant-core.c:562)
==9997== by 0x5A991E5: g_variant_builder_end (gvariant.c:3573)
==9997== by 0x5A9A8B2: g_variant_valist_new (gvariant.c:4437)
==9997== by 0x5A9AC16: g_variant_new_va (gvariant.c:4591)
==9997== by 0x5A9AD37: g_variant_new (gvariant.c:4530)
==9997== by 0x406839: check_with_new_approver (application-service-appstore.c:1508)
==9997== by 0x404799: check_with_old_approver (application-service-appstore.c:656)
==9997== by 0x5A660D6: g_list_foreach (glist.c:900)
==9997== by 0x40457B: got_all_properties (application-service-appstore.c:608)
==9997== by 0x54E591C: g_simple_async_result_complete (gsimpleasyncresult.c:744)
==9997== by 0x5542F05: reply_cb (gdbusproxy.c:2612)
==9997== by 0x54E591C: g_simple_async_result_complete (gsimpleasyncresult.c:744)
==9997== by 0x5538FB9: g_dbus_connection_call_done (gdbusconnection.c:5300)
==9997== by 0x54E591C: g_simple_async_result_complete (gsimpleasyncresult.c:744)
==9997== by 0x54E5A4B: complete_in_idle_cb (gsimpleasyncresult.c:756)
==9997== by 0x5A68DD9: g_main_context_dispatch (gmain.c:2510)
==9997== by 0x5A6919F: g_main_context_iterate.isra.23 (gmain.c:3118)
==9997== by 0x5A69599: g_main_loop_run (gmain.c:3312)
==9997== by 0x403015: main (application-service.c:69)

application-service-appstore.c:1508 is the inline use of 'g_variant_new' in a 'g_dbus_proxy_call', which should be fine according to the docs.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: indicator-application 0.4.91-0ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-18.29-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
ApportVersion: 1.94.1-0ubuntu2
Architecture: amd64
Date: Tue Mar 13 13:01:46 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20110901)
SourcePackage: indicator-application
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hernando Torque (htorque) wrote :
Olli Ries (ories)
Changed in indicator-application:
importance: Undecided → Medium
assignee: nobody → Charles Kerr (charlesk)
Revision history for this message
Charles Kerr (charlesk) wrote :

I don't see the bug here. As the description says, passing the result of a g_variant_new() call (that is, a floating GVariant) as the third argument to g_dbus_proxy_call() should be fine according to the docs: "If the parameters GVariant is floating, it is consumed. This allows convenient 'inline' use of g_variant_new()"

Hernando, are you running valgrind with G_SLICE=always-malloc ? My first guess is maybe this slice is being leaked from some other item in the same slice never being freed.

Changed in indicator-application:
status: New → Incomplete
Revision history for this message
Hernando Torque (htorque) wrote :

Yes, I was running it using G_SLICE="always-malloc" and G_DEBUG="gc-friendly".

Revision history for this message
Hernando Torque (htorque) wrote :

I'm running the service under valgrind again, and am not seeing that leak anymore:

==20111== LEAK SUMMARY:
==20111== definitely lost: 0 (+0) bytes in 0 (+0) blocks
==20111== indirectly lost: 0 (+0) bytes in 0 (+0) blocks
==20111== possibly lost: 10,100 (-88) bytes in 158 (-2) blocks
==20111== still reachable: 238,449 (-6,235) bytes in 3,996 (-38) blocks
==20111== suppressed: 0 (+0) bytes in 0 (+0) blocks

I'll let it continue for a couple of hours to make sure it's gone.

Revision history for this message
Hernando Torque (htorque) wrote :

Four hours later, nothing definitely or indirectly lost. Marking this report as invalid.

Changed in indicator-application:
status: Incomplete → Invalid
Changed in indicator-application (Ubuntu):
status: New → Invalid
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.