After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 341751 - memory leak in gnome-cd
memory leak in gnome-cd
Status: RESOLVED NOTGNOME
Product: gnome-media
Classification: Deprecated
Component: Gnome-CD
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: gnome media maintainers
gnome media maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-14 15:00 UTC by Sebastien Bacher
Modified: 2007-01-06 20:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Sebastien Bacher 2006-05-14 15:00:02 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/gnome-media/+bug/44629

"I was looking at a system today where the virtual memory usage of gnome-cd was over 700MB. It seems this program leaks over 100kB each minute.

How I assessed this on my own machine:

1) With no cd in the computer, launch "gnome-cd". Just let it sit there.

2) In a terminal, run the following pipeline:

  while true; do time=$(date +%T) ; ps --no-headers --format "$time %z" $(pgrep gnome-cd); sleep 60; done

This will print the virtual memory usage of gnome-cd each minute with a timestamp. You can exit this command with Ctrl-C.

By the way, the particular version I have is gnome-media-2.14.0-0ubuntu2."


Maybe that leak pointed by valgrind:

"==20894== 4,372 (2,628 direct, 1,744 indirect) bytes in 219 blocks are definitely lost in loss record 166 of 245
==20894==    at 0x401D7AA: calloc (vg_replace_malloc.c:279)
==20894==    by 0x4F00683: snd_output_stdio_attach (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x5F90F4B: gst_alsasink_init (gstalsasink.c:294)
==20894==    by 0x4CAE381: g_type_create_instance (gtype.c:1567)
==20894==    by 0x4C94AA1: ??? (gobject.c:1015)
==20894==    by 0x4C95114: g_object_newv (gobject.c:912)
==20894==    by 0x4C95CA4: g_object_new_valist (gobject.c:955)
==20894==    by 0x4C95E4D: g_object_new (gobject.c:793)
==20894==    by 0x40A75C1: gst_element_factory_create (gstelementfactory.c:371)
==20894==    by 0x40A78DE: gst_element_factory_make (gstelementfactory.c:434)
==20894==    by 0x40F9126: _gst_parse__yyparse (grammar.y:576)
==20894==    by 0x40FC0DD: _gst_parse_launch (grammar.y:835)
==20894==    by 0x40EEDB8: gst_parse_launch (gstparse.c:149)
==20894==    by 0x40E595B: gst_parse_bin_from_description (gstutils.c:3189)
==20894==    by 0x5F5B500: gst_gconf_render_bin_from_key (gconf.c:119)
==20894==    by 0x5F5B5D4: gst_gconf_get_default_audio_sink (gconf.c:164)
==20894==    by 0x5F58F16: ??? (gstgconfaudiosink.c:234)
==20894==    by 0x5F59592: ??? (gstgconfaudiosink.c:315)
==20894==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==20894==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==20894==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==20894==    by 0x4092F2B: gst_bin_element_set_state (gstbin.c:1753)
==20894==    by 0x40931EC: gst_bin_change_state_func (gstbin.c:1825)
==20894==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==20894==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==20894==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==20894==    by 0x575B38A: add_sink (gstplaybin.c:1062)
==20894==    by 0x575B900: setup_sinks (gstplaybin.c:1185)
==20894==    by 0x575D428: group_commit (gstplaybasebin.c:429)
==20894==    by 0x575EA0C: no_more_pads (gstplaybasebin.c:797)
==20894==    by 0x576047B: setup_source (gstplaybasebin.c:1320)
==20894==    by 0x576245D: gst_play_base_bin_change_state (gstplaybasebin.c:1790)
==20894==    by 0x575C26F: gst_play_bin_change_state (gstplaybin.c:1391)
==20894==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==20894==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==20894==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==20894==    by 0x805D882: gst_cdrom_ensure_open (gst-cdrom.c:803)
==20894==    by 0x805DAF5: gst_cdrom_get_status (gst-cdrom.c:1001)
==20894==    by 0x80585A9: gnome_cdrom_get_status (cdrom.c:572)
==20894==    by 0x8058B9D: timeout_update_cd (cdrom.c:781)
==20894==    by 0x4D60447: ??? (gmain.c:3292)
==20894==    by 0x4D5E875: g_main_context_dispatch (gmain.c:1916)
==20894==    by 0x4D61935: ??? (gmain.c:2547)
==20894==    by 0x4D61C57: g_main_loop_run (gmain.c:2751)
==20894==    by 0x4BAB476: bonobo_main (in /usr/lib/libbonobo-2.so.0.0.0)
==20894==    by 0x8053F4D: main (gnome-cd.c:1049)"

another leak pointed:

"==20894== 23,680 bytes in 740 blocks are possibly lost in loss record 228 of 245
==20894==    at 0x401D7AA: calloc (vg_replace_malloc.c:279)
==20894==    by 0x4EF7B29: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4EF8977: snd_config_make (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4EF9C4A: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4EF9A9E: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4EF9B10: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F1C253: snd_pcm_slave_conf (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F4DBDD: _snd_pcm_dmix_open (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F16EC8: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F17548: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F17773: snd_pcm_open_slave (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F53B61: _snd_pcm_softvol_open (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F16EC8: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F17796: snd_pcm_open_slave (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F35214: _snd_pcm_plug_open (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F16EC8: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F17796: snd_pcm_open_slave (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F51795: _snd_pcm_asym_open (in /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F16EC8: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x4F17548: (within /usr/lib/libasound.so.2.0.0)
==20894==    by 0x5F9370A: gst_alsasink_open (gstalsasink.c:766)
==20894==    by 0x53CDD2C: gst_audioringbuffer_open_device (gstaudiosink.c:259)
==20894==    by 0x53D5486: gst_ring_buffer_open_device (gstringbuffer.c:419)
==20894==    by 0x53D3057: gst_base_audio_sink_change_state (gstbaseaudiosink.c:780)
==20894==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==20894==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==20894==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==20894==    by 0x4092F2B: gst_bin_element_set_state (gstbin.c:1753)
==20894==    by 0x40931EC: gst_bin_change_state_func (gstbin.c:1825)
==20894==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==20894==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==20894==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==20894==    by 0x4092F2B: gst_bin_element_set_state (gstbin.c:1753)
==20894==    by 0x40931EC: gst_bin_change_state_func (gstbin.c:1825)
==20894==    by 0x5F5957C: ??? (gstgconfaudiosink.c:322)
==20894==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==20894==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==20894==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==20894==    by 0x4092F2B: gst_bin_element_set_state (gstbin.c:1753)
==20894==    by 0x40931EC: gst_bin_change_state_func (gstbin.c:1825)
==20894==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==20894==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==20894==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==20894==    by 0x575B38A: add_sink (gstplaybin.c:1062)
==20894==    by 0x575B900: setup_sinks (gstplaybin.c:1185)
==20894==    by 0x575D428: group_commit (gstplaybasebin.c:429)
==20894==    by 0x575EA0C: no_more_pads (gstplaybasebin.c:797)
==20894==    by 0x576047B: setup_source (gstplaybasebin.c:1320)
==20894==    by 0x576245D: gst_play_base_bin_change_state (gstplaybasebin.c:1790)
==20894==    by 0x575C26F: gst_play_bin_change_state (gstplaybin.c:1391)"

Another:

"==8799== 120 bytes in 6 blocks are possibly lost in loss record 105 of 247
==8799==    at 0x401C422: malloc (vg_replace_malloc.c:149)
==8799==    by 0x4F01390: snd_dlobj_cache_add (in /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4F04EBC: (within /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4EFE793: (within /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4EFE8EC: snd_determine_driver (in /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4EFC358: snd_config_hook_load_for_all_cards (in /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4EFC6B1: (within /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4EFD2F4: snd_config_searcha_hooks (in /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4EFD4DB: snd_config_search_alias_hooks (in /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4EFD62C: snd_config_search_definition (in /usr/lib/libasound.so.2.0.0)
==8799==    by 0x4F17521: (within /usr/lib/libasound.so.2.0.0)
==8799==    by 0x5F9370A: gst_alsasink_open (gstalsasink.c:766)
==8799==    by 0x53CDD2C: gst_audioringbuffer_open_device (gstaudiosink.c:259)
==8799==    by 0x53D5486: gst_ring_buffer_open_device (gstringbuffer.c:419)
==8799==    by 0x53D3057: gst_base_audio_sink_change_state (gstbaseaudiosink.c:780)
==8799==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==8799==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==8799==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==8799==    by 0x4092F2B: gst_bin_element_set_state (gstbin.c:1753)
==8799==    by 0x40931EC: gst_bin_change_state_func (gstbin.c:1825)
==8799==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==8799==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==8799==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==8799==    by 0x4092F2B: gst_bin_element_set_state (gstbin.c:1753)
==8799==    by 0x40931EC: gst_bin_change_state_func (gstbin.c:1825)
==8799==    by 0x5F5957C: ??? (gstgconfaudiosink.c:322)
==8799==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==8799==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==8799==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==8799==    by 0x4092F2B: gst_bin_element_set_state (gstbin.c:1753)
==8799==    by 0x40931EC: gst_bin_change_state_func (gstbin.c:1825)
==8799==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==8799==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==8799==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==8799==    by 0x575A72C: gen_audio_element (gstplaybin.c:808)
==8799==    by 0x575B8AF: setup_sinks (gstplaybin.c:1179)
==8799==    by 0x575D428: group_commit (gstplaybasebin.c:429)
==8799==    by 0x575EA0C: no_more_pads (gstplaybasebin.c:797)
==8799==    by 0x576047B: setup_source (gstplaybasebin.c:1320)
==8799==    by 0x576245D: gst_play_base_bin_change_state (gstplaybasebin.c:1790)
==8799==    by 0x575C26F: gst_play_bin_change_state (gstplaybin.c:1391)
==8799==    by 0x40A5093: gst_element_change_state (gstelement.c:2177)
==8799==    by 0x40A4719: gst_element_continue_state (gstelement.c:1925)
==8799==    by 0x40A5279: gst_element_change_state (gstelement.c:2210)
==8799==    by 0x40A4F2A: gst_element_set_state_func (gstelement.c:2139)
==8799==    by 0x40A4B7C: gst_element_set_state (gstelement.c:2049)
==8799==    by 0x805D882: gst_cdrom_ensure_open (gst-cdrom.c:803)
==8799==    by 0x805DA39: gst_cdrom_update_cd (gst-cdrom.c:839)
==8799==    by 0x8058A8A: gnome_cdrom_update_cd (cdrom.c:749)
==8799==    by 0x8058E7E: gnome_cdrom_construct (cdrom.c:853)"
Comment 1 Tim-Philipp Müller 2006-09-04 09:43:23 UTC
FWIW, the first leak (snd_output_stdio_attach) has been fixed in gst-plugins-base a while ago. The other two look like they might be libasound leaks to me.
Comment 2 Ronald Bultje 2007-01-06 20:30:29 UTC
Notgnome then