Ubuntu

hash tables, strings, and variants leaked in LauncherEntry.serialize()

Reported by Charles Kerr on 2012-04-14
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity
Undecided
Unassigned
libunity
Low
Charles Kerr
libunity (Ubuntu)
Low
Unassigned
Precise
Low
Unassigned

Bug Description

Test case:
1. Run valgring profiling on nautilus (with at least --leak-check=yes)
2. Confirm that the memory leaks, as noted in the original description, do not appear anymore

===

Found while running valgrind on Nautilus. This looks like a Low importance leak to me since the size of the leak is small, but I only profiled for about 30 seconds & don't know how quickly the bytes would accumulate over time.

==6455==
==6455== 444 (56 direct, 388 indirect) bytes in 1 blocks are definitely lost in loss record 19,250 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C9727D: g_slice_alloc (gslice.c:1003)
==6455== by 0x4C6BEB1: g_hash_table_new_full (ghash.c:689)
==6455== by 0x4A3C4C9: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 444 (56 direct, 388 indirect) bytes in 1 blocks are definitely lost in loss record 19,251 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C9727D: g_slice_alloc (gslice.c:1003)
==6455== by 0x4C6BEB1: g_hash_table_new_full (ghash.c:689)
==6455== by 0x4A3C4C9: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)

...etc...

==6455==
==6455== 444 (56 direct, 388 indirect) bytes in 1 blocks are definitely lost in loss record 19,250 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C9727D: g_slice_alloc (gslice.c:1003)
==6455== by 0x4C6BEB1: g_hash_table_new_full (ghash.c:689)
==6455== by 0x4A3C4C9: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 444 (56 direct, 388 indirect) bytes in 1 blocks are definitely lost in loss record 19,251 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C9727D: g_slice_alloc (gslice.c:1003)
==6455== by 0x4C6BEB1: g_hash_table_new_full (ghash.c:689)
==6455== by 0x4A3C4C9: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== 1 bytes in 1 blocks are indirectly lost in loss record 140 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC59C: g_variant_new_boolean (gvariant.c:348)
==6455== by 0x4A3C527: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 1 bytes in 1 blocks are indirectly lost in loss record 141 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC59C: g_variant_new_boolean (gvariant.c:348)
==6455== by 0x4A3C597: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 1 bytes in 1 blocks are indirectly lost in loss record 142 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC59C: g_variant_new_boolean (gvariant.c:348)
==6455== by 0x4A3C5CF: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 1 bytes in 1 blocks are indirectly lost in loss record 143 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC59C: g_variant_new_boolean (gvariant.c:348)
==6455== by 0x4A3C527: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455==
==6455== 1 bytes in 1 blocks are indirectly lost in loss record 144 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC59C: g_variant_new_boolean (gvariant.c:348)
==6455== by 0x4A3C597: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455==
==6455== 1 bytes in 1 blocks are indirectly lost in loss record 145 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC59C: g_variant_new_boolean (gvariant.c:348)
==6455== by 0x4A3C5CF: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455==
==6455== 6 bytes in 1 blocks are indirectly lost in loss record 590 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98BDA: g_strdup (gstrfuncs.c:356)
==6455== by 0x4A3C4D9: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 6 bytes in 1 blocks are indirectly lost in loss record 591 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98BDA: g_strdup (gstrfuncs.c:356)
==6455== by 0x4A3C4D9: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455==
==6455== 7 bytes in 1 blocks are indirectly lost in loss record 650 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98BDA: g_strdup (gstrfuncs.c:356)
==6455== by 0x4A3C5BD: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 7 bytes in 1 blocks are indirectly lost in loss record 651 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98BDA: g_strdup (gstrfuncs.c:356)
==6455== by 0x4A3C5BD: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455== 8 bytes in 1 blocks are indirectly lost in loss record 2,680 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC704: g_variant_new_int64 (gvariant.c:541)
==6455== by 0x4A3C4EF: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 8 bytes in 1 blocks are indirectly lost in loss record 2,681 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC7B4: g_variant_new_double (gvariant.c:624)
==6455== by 0x4A3C55F: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x400E29A: _dl_fixup (dl-runtime.c:119)
==6455== by 0x40146AF: _dl_runtime_resolve (dl-trampoline.S:37)
==6455== by 0xBE8B470F: ???
==6455==
==6455== 8 bytes in 1 blocks are indirectly lost in loss record 2,682 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC704: g_variant_new_int64 (gvariant.c:541)
==6455== by 0x4A3C4EF: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)
==6455==
==6455== 8 bytes in 1 blocks are indirectly lost in loss record 2,683 of 20,624
==6455== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6455== by 0x4C8296A: standard_malloc (gmem.c:85)
==6455== by 0x4C82E02: g_malloc (gmem.c:159)
==6455== by 0x4C98C43: g_memdup (gstrfuncs.c:384)
==6455== by 0x4C574D9: g_bytes_new (gbytes.c:95)
==6455== by 0x4CAC4EB: g_variant_new_from_trusted (gvariant.c:326)
==6455== by 0x4CAC7B4: g_variant_new_double (gvariant.c:624)
==6455== by 0x4A3C55F: unity_collect_launcher_entry_properties (in /usr/lib/libunity.so.9.0.1)
==6455== by 0x4A3C697: ??? (in /usr/lib/libunity.so.9.0.1)

Charles Kerr (charlesk) on 2012-04-14
Changed in libunity:
importance: Undecided → Low
Charles Kerr (charlesk) on 2012-04-14
summary: - GHashTable leaked in unity-launcher.vala's serialize function
+ hash tables, strings, and variants leaked in LauncherEntry.serialize()
description: updated
Changed in libunity:
assignee: nobody → Michal Hruby (mhr3)
assignee: Michal Hruby (mhr3) → Charles Kerr (charlesk)
Changed in libunity (Ubuntu):
importance: Undecided → Low
Changed in libunity (Ubuntu Precise):
status: New → Triaged
Michal Hruby (mhr3) on 2012-04-16
Changed in libunity:
status: New → In Progress
milestone: none → 5.12.0
Changed in libunity:
status: In Progress → Fix Committed
Changed in unity:
status: New → Fix Committed
description: updated
Didier Roche (didrocks) on 2012-04-27
Changed in unity:
milestone: none → 5.12.0
Didier Roche (didrocks) on 2012-04-27
Changed in libunity:
status: Fix Committed → Fix Released
Changed in unity:
status: Fix Committed → Fix Released

Hello Charles, or anyone else affected,

Accepted libunity into precise-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!

Changed in libunity (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Sebastien Bacher (seb128) wrote :

The patch is an obvious leak fix and nobody raised issues since, the update version works fine, setting as verification-done

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libunity - 5.12.0-0ubuntu1

---------------
libunity (5.12.0-0ubuntu1) precise-proposed; urgency=low

  * New upstream release.
    - Remote scopes are not restarted after crash (LP: #984760)
    - Sources filter shouldn't be shown if there's just one item (LP: #940161)
    - hash tables, strings, and variants leaked in LauncherEntry.serialize()
      (LP: #981309)
  * debian/libunity9.symbols:
    - adding an internal symbol
 -- Didier Roche <email address hidden> Fri, 27 Apr 2012 11:00:23 +0200

Changed in libunity (Ubuntu):
status: Triaged → Fix Released
Changed in libunity (Ubuntu Precise):
status: Fix Committed → Fix Released
no longer affects: libunity (Ubuntu Quantal)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers