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 621542 - Async delegates missing args on dispatch
Async delegates missing args on dispatch
Status: RESOLVED DUPLICATE of bug 604827
Product: vala
Classification: Core
Component: Async
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-14 12:31 UTC by Mikkel Kamstrup Erlandsen
Modified: 2010-06-15 09:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Vala sample illustrating the issue (714 bytes, text/x-vala)
2010-06-14 12:31 UTC, Mikkel Kamstrup Erlandsen
Details
Simpler example, without DBus (539 bytes, text/x-vala)
2010-06-14 13:28 UTC, Mikkel Kamstrup Erlandsen
Details

Description Mikkel Kamstrup Erlandsen 2010-06-14 12:31:17 UTC
Created attachment 163580 [details]
Vala sample illustrating the issue

I am attaching a program that generates bad C. The basic architecture is the DBus API defined as an interface, and then an implementing class that dispatches work to an async delegate.

This is with Vala 0.8.0. I'll test with 0.9.1 in a sec.

Terminal session:

$ valac --pkg gio-2.0 --pkg dbus-glib-1 foo.vala 

** (valac:16525): CRITICAL **: vala_ccode_expression_statement_construct: assertion `expr != NULL' failed

** (valac:16525): CRITICAL **: vala_ccode_fragment_append: assertion `node != NULL' failed
/home/kamstrup/Canonical/unity-place-files/unity-place-files.sections/foo.vala.c: In function ‘_dbus_foo_service_get_value’:
/home/kamstrup/Canonical/unity-place-files/unity-place-files.sections/foo.vala.c:244: warning: passing argument 3 of ‘foo_service_get_value’ from incompatible pointer type
/home/kamstrup/Canonical/unity-place-files/unity-place-files.sections/foo.vala.c:155: note: expected ‘GAsyncReadyCallback’ but argument is of type ‘void (*)(struct GObject *, struct GAsyncResult *, void **)’
/home/kamstrup/Canonical/unity-place-files/unity-place-files.sections/foo.vala.c: In function ‘_dbus_foo_service_get_value_ready’:
/home/kamstrup/Canonical/unity-place-files/unity-place-files.sections/foo.vala.c:261: warning: passing argument 1 of ‘foo_service_get_value_finish’ from incompatible pointer type
/home/kamstrup/Canonical/unity-place-files/unity-place-files.sections/foo.vala.c:160: note: expected ‘struct FooService *’ but argument is of type ‘struct GObject *’
/home/kamstrup/Canonical/unity-place-files/unity-place-files.sections/foo.vala.c: In function ‘_foo_service_impl_default_uint_getter_foo_uint_getter’:
/home/kamstrup/Canonical/unity-place-files/unity-place-files.sections/foo.vala.c:646: error: too few arguments to function ‘foo_service_impl_default_uint_getter’
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
Comment 1 Mikkel Kamstrup Erlandsen 2010-06-14 12:47:22 UTC
I get the exact same output with Vala 0.9.1
Comment 2 Mikkel Kamstrup Erlandsen 2010-06-14 13:28:11 UTC
Created attachment 163591 [details]
Simpler example, without DBus

Digging through the generated C code I can see most of the output above is simply casting warnings (mssing casts to GAsyncReadyCallback and FooService* etc).

The final error can be reproduced with non-DBus as well, as can be done with the simplified attached example. The problem is that the async delegate is invoked with args as though it was a normal non-async method.
Comment 3 Jürg Billeter 2010-06-15 09:32:33 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 604827 ***