GNOME Bugzilla – Bug 676607
Mem leak on decodebin when mp3 codec is not available.
Last modified: 2015-10-27 14:36:33 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.
Thanks for your report! A minimal testcase or a patch to fix the issue is welcome. :)
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;
Thanks for the patch. However, the bug should only be closed once the fix has actually been committed to the public git repository.
Sure, thanks for rectifying.
Is this still relevant with 1.x? How can it be reproduced? A testcase would be useful to have :)
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!
Most likely a duplicate of bug #756611 btw, but impossible to know for sure.