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 738223 - fluiddec: leaks memory in gst_fluid_dec_change_state()
fluiddec: leaks memory in gst_fluid_dec_change_state()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal normal
: 1.4.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-09 11:46 UTC by Antonio Ospite
Modified: 2014-10-25 12:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind log of a midi pipeline (8.03 KB, text/x-log)
2014-10-09 11:46 UTC, Antonio Ospite
  Details
fix memory leaks in fluiddec (6.56 KB, patch)
2014-10-09 11:55 UTC, Antonio Ospite
committed Details | Review

Description Antonio Ospite 2014-10-09 11:46:10 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.
Comment 1 Antonio Ospite 2014-10-09 11:55:07 UTC
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
Comment 2 Tim-Philipp Müller 2014-10-10 10:31:43 UTC
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