Comment 3 for bug 458687

Revision history for this message
In , Torello (torello-redhat-bugs) wrote :

Created attachment 345876
Testcase

Description of problem:

There is 2 bug in this package
1 - related with the mapping of dbus datatype a byte align in the buffer
2 - related with the reading from the socket

You can see these bugs in action using sugar-datastore that use DBus to do the search, for example.
I attach a tastcase that show this behaviour.

Here the command to compile it.

gmcs datastore-test.cs `pkg-config --libs ndesk-dbus-1.0` `pkg-config
--libs ndesk-dbus-glib-1.0`

Version-Release number of selected component (if applicable):

Any version

How reproducible:

Steps to Reproduce:
1. Logon using sugar interface
2. Start an activity
3. Start the terminal activity
4. From the terminal activity start the testing application.

Now can see one of two bug.
If the datastore is small you got this error:

Unhandled Exception: System.Exception: Read non-zero byte at position 4 while expecting padding
  at NDesk.DBus.MessageReader.ReadPad (Int32 alignment) [0x00000]
  at NDesk.DBus.MessageReader.ReadArray (System.Type elemType) [0x00000]
  at NDesk.DBus.MessageReader.ReadValue (System.Type type) [0x00000]
  at NDesk.DBus.MessageReader.ReadStruct (System.Type type) [0x00000]
  at NDesk.DBus.MessageReader.ReadValue (System.Type type) [0x00000]
  at NDesk.DBus.MessageHelper.GetDynamicValues (NDesk.DBus.Message msg, System.Type[] types) [0x00000]
  at NDesk.DBus.BusObject.SendMethodCall (System.String iface, System.String member, System.String inSigStr, NDesk.DBus.MessageWriter writer, System.Type retType, System.Exception& exception) [0x00000]
  at DataStoreInterfaceProxy.find (IDictionary`2 properties, System.String[] ) [0x00000]
  at datastore_test.Main (System.String[] argv) [0x00000]

If the datastore is big you got this other error:

Unhandled Exception: System.Exception: Message body length mismatch: 15800 of expected 3210520
  at NDesk.DBus.Connection.ReadMessage () [0x00000]
  at NDesk.DBus.PendingCall.get_Reply () [0x00000]
  at NDesk.DBus.Connection.SendWithReplyAndBlock (NDesk.DBus.Message msg) [0x00000]
  at NDesk.DBus.BusObject.SendMethodCall (System.String iface, System.String member, System.String inSigStr, NDesk.DBus.MessageWriter writer, System.Type retType, System.Exception& exception) [0x00000]
  at DataStoreInterfaceProxy.find (IDictionary`2 properties, System.String[] ) [0x00000]
  at datastore_test.Main (System.String[] argv) [0x00000]

You can find the new spec file (I not change the log yet) here:
http://sugar-sharp.googlecode.com/files/ndesk-dbus-glib.spec
http://sugar-sharp.googlecode.com/files/ndesk-dbus.spec