Re: [Vala] Segmentation fault when sending an integer over DBus to a service written in Python

markus korn wrote:
let's say I've a DBus service written in python, and I would like to
write a client using vala to invoke a remote method with an integer
argument (see sample code below). For me the client segfaults whenever
I try to run it.

It works with Vala 0.7.9.

So here are my questions:
 * is such scenario even possible (using a client written in vala to
access a service written in python)? does anybody have sample code for

Yes, it's possible. Your code is a good example. :)

 * did I do something wrong on the vala side which might explain the
issue (I just discovered vala today, so there is a good chance for

$ valac --version  # (ubuntu karmic)
Vala 0.7.6

You should try the Ubuntu Vala PPA:
(Don't forget to uninstall the old 'valac' package of the main repository)

$ python   # to run the service
$ valac --pkg dbus-glib-1 client.vala    # to compile the client
$ ./client   # to run the client


import gobject

import dbus
import dbus.service
import dbus.mainloop.glib

class SomeObject(dbus.service.Object):

    @dbus.service.method("org.example.Test", in_signature="i",
    def test_int(self, i):


      def TestInt(self, i):

at this point (because Vala does D-Bus method name transformation:
"test_int" -> "TestInt") and compile the client with Vala 0.7.9. Then it
should work.

Best regards,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]