Failing example program to send and receive dbus messages
j.zutt at tudelft.nl
Wed May 2 06:52:33 PDT 2007
Here is an example program that should be able to send and receive
dbus messages at the same time (using glib).
-> connector.cc [ http://cpp.sourceforge.net/?show=35316 ]
-> DbusConnection-glue.hh [ http://cpp.sourceforge.net/?show=35317 ]
Our problem is that after receiving some messages, the first attempt to
send a message results in a segfault.
The stacktrace is not always the same, see the bottom of this email for
an example trace.
- To compile:
g++ connector.cc -o connector -pthread `pkg-config --libs
- Start first instance:
./connector some.a some.b
- Start second instance:
./connector some.b some.a
Thanks in advance,
Starting program: /tmp/connector some.b some.a
[Thread debugging using libthread_db enabled]
[New Thread -1208268576 (LWP 19340)]
me some.b, he some.a
[New Thread -1208271984 (LWP 19343)]
Dbus receive thread starts glib-mainloop.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208268576 (LWP 19340)]
0x0032b3d6 in dbus_internal_do_not_use_get_uuid ()
#0 0x0032b3d6 in dbus_internal_do_not_use_get_uuid ()
#1 0x0032adfa in dbus_threads_init () from /lib/libdbus-1.so.3
#2 0x0032ae71 in dbus_threads_init () from /lib/libdbus-1.so.3
#3 0x00329029 in dbus_threads_init () from /lib/libdbus-1.so.3
#4 0x0032987e in dbus_threads_init () from /lib/libdbus-1.so.3
#5 0x003154f4 in dbus_connection_set_watch_functions ()
#6 0x003170cd in dbus_connection_open () from /lib/libdbus-1.so.3
#7 0x0031721c in dbus_connection_open () from /lib/libdbus-1.so.3
#8 0x003234d1 in dbus_pending_call_block () from /lib/libdbus-1.so.3
#9 0x00d449d8 in dbus_g_proxy_cancel_call ()
#10 0x00d48a49 in dbus_g_proxy_call () from /usr/lib/libdbus-glib-1.so.2
#11 0x08049545 in sendDBUS (msg=@0xbffda448) at connector.cc:133
#12 0x0804998a in main (argc=3, argv=0xbffda4f4) at connector.cc:161
More information about the dbus