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 796893 - splitmuxsink: Reference cycle between queue/queue pads if not explicitly removing pads
splitmuxsink: Reference cycle between queue/queue pads if not explicitly remo...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 796920 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-07-30 13:39 UTC by Sebastian Dröge (slomo)
Modified: 2018-08-14 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2018-07-30 13:39:03 UTC
Problem is that the multiqueue context has a strong reference to the queue and its pads, while at the same time both pads have a reference to the multiqueue context via the pad probe data.

If pads are explictly removed from splitmuxsink the pad probes are removed and the cycle is broken, but if it's all just unreffed then the cycle stays and things are leaked.
Comment 1 Jan Schmidt 2018-08-14 16:08:13 UTC
*** Bug 796920 has been marked as a duplicate of this bug. ***
Comment 2 Jan Schmidt 2018-08-14 16:12:37 UTC
Test case from bug 796920:

    $ GST_TRACERS="leaks" GST_DEBUG="GST_TRACER:7" GST_DEBUG_COLOR_MODE=off gst-launch-1.0 videotestsrc num-buffers=200 ! openh264enc ! h264parse ! splitmuxsink location="output.mp4"
Comment 3 Jan Schmidt 2018-08-14 16:29:58 UTC
This fixes it here:

commit f8076e208bc940ed76d7cb58e11a31fc4b813957
Author: Jan Schmidt <jan@centricular.com>
Date:   Wed Aug 15 02:10:25 2018 +1000

    splitmuxsink: Fix reference counting loop
    
    The stream context was holding a reference to the
    internal queue and pads, with pad probes that were
    in turn holding references to the stream context.
    
    This lead to a leak if the request pads weren't explicitly
    released.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=796893