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 756968 - rtsp-stream: GstBin leak in udp-mcast case
rtsp-stream: GstBin leak in udp-mcast case
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal normal
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-22 14:01 UTC by David Svensson Fors
Modified: 2015-10-23 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtsp-stream: plug GstBin leak in udp-mcast case (1.03 KB, patch)
2015-10-22 14:01 UTC, David Svensson Fors
committed Details | Review

Description David Svensson Fors 2015-10-22 14:01:16 UTC
Created attachment 313862 [details] [review]
rtsp-stream: plug GstBin leak in udp-mcast case

When setting a GstRTSPMedia to playing, GstRTSPStreamTransports are added to GstRTSPStreams. Then, the function update_transport() in rtsp-stream.c is called. We have found a leak here for udp-mcast transports. Part of a valgrind log:

Running suite(s): rtp
==27802== 19,599 (776 direct, 18,823 indirect) bytes in 1 blocks are definitely lost in loss record 4,271 of 4,276
==27802==    at 0x7653B8C: g_type_create_instance (gtype.c:1847)
==27802==    by 0x7637F30: g_object_new_internal (gobject.c:1724)
==27802==    by 0x7639B9C: g_object_newv (gobject.c:1868)
==27802==    by 0x7262B86: gst_element_factory_create (gstelementfactory.c:376)
==27802==    by 0x72630A3: gst_element_factory_make (gstelementfactory.c:446)
==27802==    by 0x7344852: priv_gst_parse_yyparse (grammar.y:688)
==27802==    by 0x734891F: priv_gst_parse_launch (grammar.y:1050)
==27802==    by 0x7334E02: gst_parse_launch_full (gstparse.c:325)
==27802==    by 0x7334C79: gst_parse_launch (gstparse.c:290)
==27802==    by 0x6C528FC: default_create_element (rtsp-media-factory.c:1176)
==27802==    by 0x6C5324A: gst_rtsp_media_factory_create_element (rtsp-media-factory.c:1344)
...
100%: Checks: 3, Failures: 0, Errors: 0
Makefile:3762: recipe for target 'rtp/rtp.valgrind' failed
make: *** [rtp/rtp.valgrind] Error 1

It is a GstBin that leaks in update_transport(). The attached patch contains a fix for this.
Comment 1 David Svensson Fors 2015-10-22 14:11:20 UTC
Bug #756969 contains a patch with a new unit test that exposes this problem when run in valgrind.
Comment 2 Sebastian Dröge (slomo) 2015-10-22 16:29:23 UTC
Comment on attachment 313862 [details] [review]
rtsp-stream: plug GstBin leak in udp-mcast case

commit 81ae320383894892b4b4b53482a04c998441430d
Author: David Svensson Fors <davidsf@axis.com>
Date:   Thu Oct 22 09:15:21 2015 +0200

    rtsp-stream: Always unref return value of gst_object_get_parent()
    
    Fixes a leak of a GstBin in the udp-mcast case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756968