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 543101 - The udpsrc/udpsink/multiudpsink/dynudpsink elements may leak file descriptors
The udpsrc/udpsink/multiudpsink/dynudpsink elements may leak file descriptors
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.11
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-15 14:07 UTC by Peter Kjellerstedt
Modified: 2008-08-20 11:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Close socket owned by the udp element (7.48 KB, patch)
2008-07-15 14:08 UTC, Peter Kjellerstedt
none Details | Review

Description Peter Kjellerstedt 2008-07-15 14:07:31 UTC
If one has set the closefd property to TRUE (which it is by default) and specified a socket via the sockfd property for either of udpsrc, udpsink, multiudpsink or dynudpsink, the element will leak the file descriptor in case it is never set to the PAUSED state even though the closefd property indicates that the element is the owner of the file descriptor. It will also use a closed file descriptor in case it is set to PAUSED again after having gone from PAUSED to READY...

The attached patch should fix these problems. I do not think it warrants a blocker for the pending -good release, so I intend to commit it once -good is thawed (and I am back from vacation). But if anyone feels like committing it before then, feel free. ;)
Comment 1 Peter Kjellerstedt 2008-07-15 14:08:27 UTC
Created attachment 114597 [details] [review]
Close socket owned by the udp element
Comment 2 Wim Taymans 2008-08-20 11:51:39 UTC
        Patch by: Peter Kjellerstedt <pkj at axis com>

        * gst/udp/gstdynudpsink.c: (gst_dynudpsink_init),
        (gst_dynudpsink_finalize), (gst_dynudpsink_set_property),
        (gst_dynudpsink_init_send), (gst_dynudpsink_close):
        * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_init),
        (gst_multiudpsink_finalize), (gst_multiudpsink_set_property):
        * gst/udp/gstudpsrc.c: (gst_udpsrc_finalize),
        (gst_udpsrc_set_property):
        Avoid leaking internally allocated file descriptors when setting 
        custom file descriptors. Fixes #543101.