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 790986 - udpsink memory leak in gst_multiudpsink_start
udpsink memory leak in gst_multiudpsink_start
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.12.3
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-29 14:53 UTC by Alvaro Margulis
Modified: 2017-12-08 00:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alvaro Margulis 2017-11-29 14:53:45 UTC
Memory leak reported by valgrind

==27726== 144 (40 direct, 104 indirect) bytes in 1 blocks are definitely lost in loss record 8,485 of 8,878
==27726==    at 0x56C0A3A: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.4200.2)
==27726==    by 0x56A525C: ??? (in /usr/lib64/libgobject-2.0.so.0.4200.2)
==27726==    by 0x56A71D3: g_object_new_valist (in /usr/lib64/libgobject-2.0.so.0.4200.2)
==27726==    by 0x56A75D0: g_object_new (in /usr/lib64/libgobject-2.0.so.0.4200.2)
==27726==    by 0xD9C0E22: gst_multiudpsink_start.5131 (in /usr/lib64/gstreamer-1.0/libgstudp.so)
==27726==    by 0x5E47731: gst_base_sink_change_state.5296 (in /usr/lib64/libgstbase-1.0.so.0)
==27726==    by 0x54145B7: gst_element_change_state (in /usr/lib64/libgstreamer-1.0.so.0)
==27726==    by 0x53F104B: gst_element_set_state_func.13613 (in /usr/lib64/libgstreamer-1.0.so.0)
==27726==    by 0x53F03C6: gst_bin_change_state_func.4657 (in /usr/lib64/libgstreamer-1.0.so.0)
==27726==    by 0x54145B7: gst_element_change_state (in /usr/lib64/libgstreamer-1.0.so.0)
==27726==    by 0x53F104B: gst_element_set_state_func.13613 (in /usr/lib64/libgstreamer-1.0.so.0)
==27726==    by 0x40EF2B: gst_sdk_cr_stream (gst_sdk.c:690)
Comment 1 Alvaro Margulis 2017-11-29 14:56:07 UTC
The object GSocketAddress is not released in case of IP v4 socket.
Comment 2 Sebastian Dröge (slomo) 2017-11-29 15:26:17 UTC
Do you want to provide a patch for this?
Comment 3 Alvaro Margulis 2017-11-29 15:56:50 UTC
I fixed it this way:

svn diff
Index: gstmultiudpsink.c
===================================================================
--- gstmultiudpsink.c   (revision 50810)
+++ gstmultiudpsink.c   (working copy)
@@ -1362,6 +1362,7 @@
       }
 
       g_socket_bind (sink->used_socket, bind_addr, TRUE, &err);
+      g_object_unref (bind_addr);
       if (err != NULL)
         goto bind_error;
     } else {
Comment 4 Thiago Sousa Santos 2017-11-30 08:39:33 UTC
Thanks for reporting and providing the diff. 

Would you mind providing a patch in git format-patch format? Preferably with author and email set so we can track authorship. Thanks!
Comment 5 Tim-Philipp Müller 2017-12-08 00:38:40 UTC
Pushed:

commit 66f253ed9bdfd39d89a68945283dd375c23a106c
Author: Alvaro Margulis <alvaro.margulis@cirpack.com>
Date:   Fri Dec 8 00:31:32 2017 +0000

    multiudpsink: fix bind address leak
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790986


For future reference:
https://gstreamer.freedesktop.org/documentation/contribute/index.html#how-to-submit-patches