[Bug 688703] New: rtsp-stream: socket leak

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Nov 19 23:52:55 PST 2012


https://bugzilla.gnome.org/show_bug.cgi?id=688703
  GStreamer | gst-rtsp-server | git

           Summary: rtsp-stream: socket leak
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-rtsp-server
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: davidsf at axis.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


In gst-rtsp-server, I run a unit test in Valgrind:

GST_CHECKS=test_describe make -C tests/check gst/rtspserver.valgrind

I get several leaks. One of them looks like this:

==1069== Thread 1:
==1069== 240 bytes in 3 blocks are definitely lost in loss record 3,342 of
3,477
==1069==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1069==    by 0x6A5AF30: g_malloc (gmem.c:159)
==1069==    by 0x6A6F322: g_slice_alloc (gslice.c:1003)
==1069==    by 0x6A6F875: g_slice_alloc0 (gslice.c:1029)
==1069==    by 0x61DD9F9: g_type_create_instance (gtype.c:1872)
==1069==    by 0x61C2817: g_object_constructor (gobject.c:1849)
==1069==    by 0x61C3DE0: g_object_newv (gobject.c:1713)
==1069==    by 0x61C45CF: g_object_new_valist (gobject.c:1830)
==1069==    by 0x572A8CD: g_initable_new_valist (ginitable.c:224)
==1069==    by 0x572A9C8: g_initable_new (ginitable.c:148)
==1069==    by 0x5740135: g_socket_new (gsocket.c:1010)
==1069==    by 0xB25D4A8: gst_udpsrc_start (gstudpsrc.c:770)
==1069==    by 0x508662D: gst_base_src_start (gstbasesrc.c:3123)
==1069==    by 0x5086A07: gst_base_src_activate_mode (gstbasesrc.c:3491)
==1069==    by 0x5C97B32: gst_pad_activate_mode (gstpad.c:1060)
==1069==    by 0x5C98380: gst_pad_set_active (gstpad.c:936)
==1069==    by 0x5C7B8A2: activate_pads (gstelement.c:2679)
==1069==    by 0x5C8AED3: gst_iterator_fold (gstiterator.c:614)
==1069==    by 0x5C7BAA4: iterator_activate_fold_with_resync.constprop.2
(gstelement.c:2699)
==1069==    by 0x5C7D8E8: gst_element_pads_activate (gstelement.c:2735)

A socket, that is created in gst_udpsrc_start, leaks. It turns out that this
leak is in alloc_ports in rtsp-stream.c. A GSocket is fetched from a GstUDPSrc
using g_object_get and set in a GstUPDSink using g_object_set. g_object_get
gives an extra reference, and this reference is not taken back by g_object_set.
(gst_multiudpsink_set_property uses g_value_dup_object for saving the socket in
the GstUDPSink.)

The attached patch is a suggested fix for the leak. GSocket references are
unreffed in two places with similar code.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list