[pulseaudio-tickets] [Bug 74213] alsa: hctl memory leak

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jan 30 03:50:47 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=74213

--- Comment #1 from poljarinho at gmail.com ---
I found this as well a while back. I investigated a little further.
Pulseaudio's
handling seems to be fine since mixer_close() also calls free on the mixer.

Here is a valgrind report with full debugging symbols.

==12209== HEAP SUMMARY:
==12209==     in use at exit: 54,987 bytes in 175 blocks
==12209==   total heap usage: 61,729 allocs, 61,554 frees, 8,849,995 bytes
allocated
==12209== 
==12209== 80 bytes in 5 blocks are definitely lost in loss record 20 of 29
==12209==    at 0x4C27730: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12209==    by 0x1063B06E: bag_new (bag.c:26)
==12209==    by 0x1063B6B7: hctl_event_handler (mixer.c:177)
==12209==    by 0x1062DC0E: snd_hctl_throw_event (hcontrol.c:205)
==12209==    by 0x1062EA94: snd_hctl_load (hcontrol.c:614)
==12209==    by 0x1063C24B: snd_mixer_load (mixer.c:576)
==12209==    by 0x103BAFE2: prepare_mixer (alsa-util.c:1506)
==12209==    by 0x103BB374: pa_alsa_open_mixer (alsa-util.c:1529)
==12209==    by 0x101A5868: module_alsa_card_LTX_pa__init
(module-alsa-card.c:503)
==12209==    by 0x4E5E184: pa_module_load (module.c:174)
==12209==    by 0xFD8B8D6: verify_access (module-udev-detect.c:341)
==12209==    by 0xFD8CB2E: module_udev_detect_LTX_pa__init
(module-udev-detect.c:489)
==12209== 
==12209== LEAK SUMMARY:
==12209==    definitely lost: 80 bytes in 5 blocks
==12209==    indirectly lost: 0 bytes in 0 blocks
==12209==      possibly lost: 0 bytes in 0 blocks
==12209==    still reachable: 54,907 bytes in 170 blocks
==12209==         suppressed: 0 bytes in 0 blocks

So in this Pulseaudio run, alsa-lib calls bag_new 177 times, but it frees only 
172 bags (this was checked by adding printf statements after a bag was
added/removed,
if anyone wonders).

Now there is a nice warning file about leaks in the alsa-lib source tree:

> The biggest reported leak is that the global configuration is cached for
> next usage. If you do not want this feature, simply, call
> snd_config_update_free_global() after all snd_*_open*() calls. This function
> will free the cache.

I haven't investigated if this warning applies to us.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20140130/a0a58c04/attachment.html>


More information about the pulseaudio-bugs mailing list