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 688907 - DBusProxy.call_with_unix_fd_list is unusable
DBusProxy.call_with_unix_fd_list is unusable
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: D-Bus
0.18.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-23 02:53 UTC by Michael Terry
Modified: 2018-05-22 14:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Terry 2012-11-23 02:53:09 UTC
DBusProxy.call_with_unix_fd_list (and I assume its sister function DBusConnection.call_with_unix_fd_list?) do not generate code that works.

Specifically, I see it generate code like:
<GVariant*> = g_dbus_proxy_call_with_unix_fd_list_finish (<GDBusProxy*>, <GAsyncResult*>, <GUnixFDList**>, <GError**>);

But it *should* be generating code like:
<GVariant*> = g_dbus_proxy_call_with_unix_fd_list_finish (<GDBusProxy*>, <GUnixFDList**>, <GAsyncResult*>, <GError**>);

(That is, the result and fd list arguments should be swapped.)

This obviously results in a build warning and runtime failure.
Comment 1 Luca Bruno 2012-11-23 09:57:20 UTC
Is there any reason why you are using this method (besides the fact that is broken)? You can use fd list by calling dbus methods with unix streams and vala will automatically create fd lists for you. See tests as an example: http://git.gnome.org/browse/vala/tree/tests/dbus/filedescriptor.test
Comment 2 Michael Terry 2012-11-26 03:56:30 UTC
I could do that.  But I suspect I'd run into bug https://bugzilla.gnome.org/show_bug.cgi?id=688838, this time on the client side.

The specific code I was working with had a return format like "ah".  So I suppose Vala wouldn't pick up on it?  It certainly wouldn't be able to if the format was "av" with handles inside the "v".  So this function (call_with_unix_fd_list) is still useful.
Comment 3 Luca Bruno 2012-11-26 09:23:01 UTC
I believe the method can be fixed by using the CCode pos on the parameter to come before the GAsyncResult, though I'm not very sure of this.

As for "ah", we may want Vala to handle that case. For "av", it may be done on the client side as well, to pack an fd in a variant like any other type... no idea on the server side.
Comment 4 Robert Ancell 2013-10-21 20:20:09 UTC
Also occurs for DBusConnection.call_with_unix_fd_list (see bug 710583)
Comment 5 GNOME Infrastructure Team 2018-05-22 14:37:36 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME'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.gnome.org/GNOME/vala/issues/340.