GNOME Bugzilla – Bug 738223
fluiddec: leaks memory in gst_fluid_dec_change_state()
Last modified: 2014-10-25 12:15:08 UTC
Created attachment 288112 [details] valgrind log of a midi pipeline Hi, running the following pipeline under valgrind I get some "definitely lost" blocks: wget -nc http://www.midishrine.com/midipp/nes/Super_Mario_Bros/smb1-1up.mid gst-launch-1.0 filesrc location=smb1-1up.mid ! midiparse ! fluiddec ! fakesink Full valgrind log attached. A patch fixing most of the leaks is on its way.
Created attachment 288114 [details] [review] fix memory leaks in fluiddec The attached patch fixes the leaks in fluiddec, they are actually in gst_fluid_dec_open(). I am also squeezing in a small documentation fix to midiparse as a separate commit. After this patch two leaks with the pipeline above are still present. One in is the fluidsynth library itself and it has been fixed upstream already http://sourceforge.net/p/fluidsynth/tickets/132/ so no need to worry. Another one seems to be in GStreamer itself, maybe in some cases some events are not unreffed? Should I report this in a separate issue? ==10070== ==10070== 208 (32 direct, 176 indirect) bytes in 1 blocks are definitely lost in loss record 1,760 of 1,826 ==10070== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==10070== by 0x53E87C9: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.0) ==10070== by 0x53FF70F: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.0) ==10070== by 0x4EBC762: gst_structure_new_id_empty_with_size (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.403.0) ==10070== by 0x4EBEEAE: gst_structure_new_id (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.403.0) ==10070== by 0x4E8A1F7: gst_event_new_caps (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.403.0) ==10070== by 0x749F3C0: gst_midi_parse_loop (in /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmidi.so) ==10070== by 0x4EC9A15: gst_task_func (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.403.0) ==10070== by 0x540A2B7: g_thread_pool_thread_proxy (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.0) ==10070== by 0x5409924: g_thread_proxy (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.0) ==10070== by 0x56B00A3: start_thread (pthread_create.c:309) Thanks, Antonio
Pushed, thanks for the patches! commit bc835743a4b6cad2d609093b4512449eb2846195 Author: Antonio Ospite <ao2@ao2.it> Date: Tue Oct 7 17:05:04 2014 +0200 midiparse: mention fluiddec instead of fluidsynth The element name is actually fluiddec even if it uses fluidsynth. https://bugzilla.gnome.org/show_bug.cgi?id=738223 commit 28d9826fd511feb82d358674c4d5d0bddd7f0ff2 Author: Antonio Ospite <ao2@ao2.it> Date: Thu Oct 9 11:51:16 2014 +0200 fluiddec: fix some memory leaks https://bugzilla.gnome.org/show_bug.cgi?id=738223