Discussion:
[Bug 761844] New: rtsp-server: tls client socket leaks when using new main context
"GStreamer" (GNOME Bugzilla)
2016-02-11 00:01:06 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

Bug ID: 761844
Summary: rtsp-server: tls client socket leaks when using new
main context
Classification: Platform
Product: GStreamer
Version: unspecified
OS: Linux
Status: NEW
Severity: normal
Priority: Normal
Component: gst-rtsp-server
Assignee: gstreamer-***@lists.freedesktop.org
Reporter: ***@gmail.com
QA Contact: gstreamer-***@lists.freedesktop.org
GNOME version: ---

Created attachment 320835
--> https://bugzilla.gnome.org/attachment.cgi?id=320835&action=edit
test-video with different main context

I've updated our streaming server to use GStreamer 1.6.3 (gst-rtsp-server
1.6.2), glib 2.46.2 and glib-networking 2.46.1.

There's an RTSP TLS socket leak for the socket used to communicate back with
the client.

The leak only happens occurs if a different GMainContext is used. I'm attaching
a patch for the examples/test-video.c.

Once the server is running just run a client with:

$ gst-launch-1.0 rtspsrc location=rtsps://user:***@127.0.0.1:8554/test
tls-validation-flags=0 ! fakesink silent=false -v

lsof will show the leaks.

This worked before with GStreamer 1.4.5, glib 2.42.0 and glib-networking 2.42.0
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-02-11 00:01:33 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

Aleix Conchillo Flaqué <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com
Version|unspecified |1.6.3
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-02-11 00:04:27 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

--- Comment #1 from Aleix Conchillo Flaqué <***@gmail.com> ---
Created attachment 320836
--> https://bugzilla.gnome.org/attachment.cgi?id=320836&action=edit
no socket leak ref/unref stack traces

Stack traces for all the g_object_ref/unref. This is with the problem fixed
(using main context).
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-02-11 00:05:00 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

--- Comment #2 from Aleix Conchillo Flaqué <***@gmail.com> ---
Created attachment 320837
--> https://bugzilla.gnome.org/attachment.cgi?id=320837&action=edit
socket leak ref/unref stack traces

Stack traces for all the g_object_ref/unref. One g_object_unref missing.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-02-11 00:10:43 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

--- Comment #3 from Aleix Conchillo Flaqué <***@gmail.com> ---
Also, this is from valgrind with --track-fds=yes.

It is from my application but it shows where the socket leak comes from.

==29769== Open AF_INET socket 16: 127.0.0.1:8554 <-> unbound
==29769== at 0x566E05D: ??? (syscall-template.S:81)
==29769== by 0x7A6FD0F: g_socket_accept (gsocket.c:2258)
==29769== by 0x74B46DE: gst_rtsp_connection_accept (gstrtspconnection.c:446)
==29769== by 0x728CFC6: gst_rtsp_server_io_func (rtsp-server.c:1169)
==29769== by 0x7A6DD70: socket_source_dispatch (gsocket.c:3284)
==29769== by 0x8036B19: g_main_dispatch (gmain.c:3154)
==29769== by 0x8036B19: g_main_context_dispatch (gmain.c:3769)
==29769== by 0x8036EDF: g_main_context_iterate.isra.29 (gmain.c:3840)
==29769== by 0x8037201: g_main_loop_run (gmain.c:4034)
==29769== by 0x4E9CD29: thread_func(void*) (XXXXXXXX.C:374)
==29769== by 0x56656A9: start_thread (pthread_create.c:333)
==29769== by 0x5982EEC: clone (clone.S:109)
==29769==
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-02-17 14:28:04 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

Sebastian Dröge (slomo) <***@coaxion.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@coaxion.net
Attachment #320835|none |rejected
status| |
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-02-17 14:28:21 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

--- Comment #4 from Sebastian Dröge (slomo) <***@coaxion.net> ---
Aleix, did you succeed with creating a patch for this?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-02-17 19:30:00 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

--- Comment #5 from Aleix Conchillo Flaqué <***@gmail.com> ---
(In reply to Sebastian Dröge (slomo) from comment #4)
Post by "GStreamer" (GNOME Bugzilla)
Aleix, did you succeed with creating a patch for this?
No, what I did is use the default main context in my server instead of using a
new one.

I'll try to find some time to debug this. I'm curious to see where the problem
is. My guts tell me it's in glib, but it's just a guess.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-06-20 12:15:04 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

Tim-Philipp Müller <***@zen.co.uk> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@zen.co.uk

--- Comment #6 from Tim-Philipp Müller <***@zen.co.uk> ---
Aleix, did you have any chance to look into this again?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-06-21 08:30:43 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

Sebastian Dröge (slomo) <***@coaxion.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2016-06-21 08:36:36 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

--- Comment #7 from Aleix Conchillo Flaqué <***@gmail.com> ---
No, no time. We are swamped. Last week we made it pushing the srtp related
ones, even not planned. Yesterday, I flew to Barcelona so I'm going to spend a
few weeks working with Josep. Not sure if we will have time for this though.

May be there's even a chance that something got fixed in glib.... ?

I'll at least try it in a few days and see if it's still reproducible.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-01-15 15:37:30 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

Tim-Philipp Müller <***@zen.co.uk> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
Version|1.6.3 |git master

--- Comment #8 from Tim-Philipp Müller <***@zen.co.uk> ---
This still seems to be a problem. I can reproduce this.

The test example is leaking some things that should be unrefed (server, loop,
context) as well, but even then I get this socket fd leak.

Strangely enough it seems to only leak the fd itself but I don't get leaks for
any socket objects/structs reported in valgrind.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
"GStreamer" (GNOME Bugzilla)
2018-11-03 15:39:43 UTC
Permalink
https://bugzilla.gnome.org/show_bug.cgi?id=761844

GStreamer system administrator <***@gstreamer.net> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |OBSOLETE

--- Comment #9 from GStreamer system administrator <***@gstreamer.net> ---
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been
closed from further activity.

You can subscribe and participate further through the new bug through this link
to our GitLab instance:
https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/20.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
Loading...