-1

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.

  1. App is supposed to send 150 signals on dbus and another app is receiving these signals. (No issues here in send & receive).
  2. 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...
  3. The sequence of dbus APIs are all correct and verified by referencing multiple sample source code.
  4. All of above works fine, but on the standalone ubuntu system, i can always see segmentation fault, on dbus_connection_send() call.
  5. 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

Manse
  • 37,765
  • 10
  • 83
  • 108
manojjk
  • 1
  • 1
  • Question is exploratory or vague, and doesn’t include enough details to know what the code is doing or how to diagnose the problem. – Philip Withnall Jun 22 '17 at 10:13

1 Answers1

0

I dont know if you have heard about dbus related debugging tools. For beginning you can try calling the exposed functions using some dbus-debugging-tool. If it doesnt throw segmentation fault when you call using the tool, then probably you should look for issues in your code. Otherwise you should check things related to environment.

One such tool is - DFeet

Another such debugger(commandline based) is provided by Qt people as well.

Amit Tomar
  • 4,800
  • 6
  • 50
  • 83