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 676607 - Mem leak on decodebin when mp3 codec is not available.
Mem leak on decodebin when mp3 codec is not available.
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.35
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-23 00:07 UTC by Jun Zhu
Modified: 2015-10-27 14:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstreamer log related to decodebins (242.06 KB, text/plain)
2012-05-23 00:07 UTC, Jun Zhu
Details

Description Jun Zhu 2012-05-23 00:07:24 UTC
Created attachment 214717 [details]
gstreamer log related to decodebins

We are running gstreamer to play some music files including ogg and mp3 files. At this moment mp3 codec is not available(for some reason) in our platform but maybe will be supported in the future. When we are playing a playlist with some mp3 file in, it was found some decodebins for mp3 were not disposed. If the codec is available, then it wouldn't leak. 

adapter created in mpegaudioparse is also not released at all, which caused a major leak when "playing" plenty of mp3 files (unsupported as mentioned above) and may be caused by unreleased decodebin.

Not sure if there is anybody met this issue before. Attached is the gstreamer log related to decodebins. Any help would be greatly appreciated.
Comment 1 André Klapper 2012-05-23 11:04:21 UTC
Thanks for your report! 
A minimal testcase or a patch to fix the issue is welcome. :)
Comment 2 Jun Zhu 2012-05-30 05:03:22 UTC
Found the reason. In some situation when a codec is not available, decodebin2 would change its state to NULL with some message unprocessed in its message queue, which referring the decodebin2 itself and all its children. Patch below will fix this issue:

diff --git a/gst/gstbin.c b/gst/gstbin.c
index f3d1b56..02c750d 100644
--- a/gst/gstbin.c
+++ b/gst/gstbin.c
@@ -2473,6 +2473,11 @@ gst_bin_change_state_func (GstElement * element, GstStateChange transition)
           goto activate_failure;
       break;
     case GST_STATE_NULL:
+      /* Clear message list on next NULL */
+      GST_OBJECT_LOCK (bin);
+      GST_DEBUG_OBJECT (element, "clearing all cached messages before NULL");
+      bin_remove_messages (bin, NULL, GST_MESSAGE_ANY);
+      GST_OBJECT_UNLOCK (bin);
       if (current == GST_STATE_READY)
         if (!(gst_bin_src_pads_activate (bin, FALSE)))
           goto activate_failure;
Comment 3 Tim-Philipp Müller 2012-05-30 06:07:02 UTC
Thanks for the patch.

However, the bug should only be closed once the fix has actually been committed to the public git repository.
Comment 4 Jun Zhu 2012-05-30 06:09:59 UTC
Sure, thanks for rectifying.
Comment 5 Sebastian Dröge (slomo) 2014-02-23 10:26:18 UTC
Is this still relevant with 1.x? How can it be reproduced? A testcase would be useful to have :)
Comment 6 Sebastian Dröge (slomo) 2015-10-27 14:35:43 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!
Comment 7 Sebastian Dröge (slomo) 2015-10-27 14:36:33 UTC
Most likely a duplicate of bug #756611 btw, but impossible to know for sure.