DBusGMethodInvocation is null on i386, works on x86_64

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Oct 24 04:27:12 PDT 2008


On Fri, 24 Oct 2008 at 02:56:16 -0400, Braden McDaniel wrote:
> I'm observing a situation where the DBusGMethodInvocation pointer passed
> to the implementation of a remote call is null on i386; but the same
> code works as expected on x86_64.
> 
> I have the following XML:
> 
>         <node name="/org/openvrml/BrowserFactory">
>           <interface name="org.openvrml.BrowserFactory">
>             <method name="CreateControl">
>               <annotation name="org.freedesktop.DBus.GLib.Async" value="true" />
>               <arg type="s" name="host_name" direction="in" />
>               <arg type="o" name="host_object_path" direction="in" />
>               <arg type="t" name="host_id" direction="in" />

This is a 64-bit unsigned integer...

>               <arg type="b" name="expect_initial_stream" direction="in" />
>               <arg type="o" direction="out">
>                 <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
>               </arg>
>             </method>
>           </interface>
>         </node>

>         gboolean
>         openvrml_xembed_browser_factory_create_control(
>             OpenvrmlXembedBrowserFactory * control_factory,
>             const char * host_name,
>             const char * host_obj_path,
>             guint host_id,

but this is the same size as an int, so on platforms with 32-bit int, your
arguments are misaligned.

The dbus-glib types for integers go like this:

D-Bus BYTE = GLib guchar
D-Bus BOOLEAN = GLib gboolean
D-Bus INT16 or INT32 = GLib gint (at least 32 bits, maybe more!)
D-Bus UINT16 or UINT32 = GLib guint (at least 32)
D-Bus INT64 = GLib gint64 (always 64 bits)
D-Bus UINT64 = GLib guint64 (always 64)

    Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20081024/421dfdf3/attachment.pgp 


More information about the dbus mailing list