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 765249 - udpsrc: external socket should not be unreffed upon disposal
udpsrc: external socket should not be unreffed upon disposal
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.8.0
Other All
: Normal major
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-19 07:58 UTC by Marcin Lewandowski
Modified: 2016-05-22 17:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marcin Lewandowski 2016-04-19 07:58:34 UTC
If udpsrc is used with external socket (passed via socket property), this socket is unreffed upon element disposal, despite ownership being not transferred.

Sample code:


public static int main(string[] argv) {
	Gst.init(ref argv);

	var socket = new Socket(SocketFamily.IPV4, SocketType.DATAGRAM, SocketProtocol.UDP);
	socket.bind(new InetSocketAddress(new InetAddress.any(SocketFamily.IPV4), 0), true);

	var pipeline = new Gst.Pipeline("pipeline");

	dynamic Gst.Element source = Gst.ElementFactory.make("udpsrc", "source");
	source.socket = socket;

	dynamic Gst.Element sink = Gst.ElementFactory.make("fakesink", "sink");

	pipeline.add(source);
	pipeline.add(sink);

	source.link(sink);

	pipeline.set_state(Gst.State.PLAYING);
	pipeline.set_state(Gst.State.NULL);
	pipeline.set_state(Gst.State.PLAYING);


	return 0;
}

Compile with valac --pkg gstreamer-1.0 --pkg gio-2.0 udpsrc.vala


Produces:

(udpsrc:42922): GLib-GIO-CRITICAL **: g_inet_socket_address_get_address: assertion 'G_IS_INET_SOCKET_ADDRESS (address)' failed

(udpsrc:42922): GLib-GIO-CRITICAL **: g_inet_address_get_is_multicast: assertion 'G_IS_INET_ADDRESS (address)' failed

(udpsrc:42922): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed


If the intention was to transfer ownership of socket into element, it is not documented behaviour. 

But IMO it should not behave like this - you may want to ensure that socket is constantly bound across state changes (e.g. so no other process will intercept it).
Comment 1 Sebastian Dröge (slomo) 2016-04-19 08:39:45 UTC
I don't see anything wrong in the code while shortly looking over it. Can you provide a testcase in C please?

The socket property takes an additional reference when storing the socket internally
Comment 2 Sebastian Dröge (slomo) 2016-04-19 08:43:10 UTC
Also can you get a stacktrace of the critical? I assume it's completely unrelated to the socket, but somehow a bug with keeping track of the socket address.
Comment 3 Tim-Philipp Müller 2016-05-22 17:43:59 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!