I am a beginner to DBus and wrote one sample application using dbus but i am facing a weird problem. My app is running fine on guest os as Ubuntu (On virtual box with windows host ) but the same app is not working on standalone Ubuntu system (also tried on meego, no luck thr as well).
Then, i verified the obvious doubts on dbus, glib libraries versions. Its same on both the environments, and the issue is consistent. I mean the app always runs without any prob on virtual box and always crashes on the standalone ubuntu.
Here is the brief desc about the issue.
- App is supposed to send 150 signals on dbus and another app is receiving these signals. (No issues here in send & receive).
- I have an array of DbusMessage[150] (also tried with the list of 150 DBusMessage)...appending the arguments on to the dbus msg and sending on to bus..one at a time...no looping...
- The sequence of dbus APIs are all correct and verified by referencing multiple sample source code.
- All of above works fine, but on the standalone ubuntu system, i can always see segmentation fault, on dbus_connection_send() call.
I reverified everypossible places where in "seg faults" can happen and it all looks fine to me. This is how i am appending my arg to dbus message.
dbus_message_append_args(pDbusMsg, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &pData, sizeof(pData), DBUS_TYPE_INVALID) != TRUE)
then connection send..and then calling dbus_connection_flush()
. Also as my app has to send the same message again (but not immediately), i am re registering the same signal by calling dbus_message_new_signal()
..i have verified all the pointers / memory / dbusmessage..everything looks fine and works fine on virtualized ubuntu os.
Just to add, i tried sending with dbus_connection_send_preallocated()
and it works fine for few messages(10-15~), but not consistent enough.
Have you ever had this kind of issue, please let me know any clue to solve this prob....Any help would be appreciated or any examples/tutorials as well taking into consideration I'm just starting out with dbus :P
Thanks