crash in dbus

Thomas Green TGreen2 at Sorenson.com
Tue Dec 2 18:50:03 PST 2014


I am cross posting this to dbus and connman.  I have an issue where I am trying to make a call to connman using dbus and I get a crash in dbus. 

I have a class that makes various connman calls, and also is set up to receive messages asynchronously.  So, In my class, I run a new thread that it's only purpose is to create a g_main_loop, then run it, the main part of the class is called when the user wants to initiate various events (for example a wireless scan), and to respond to connman messages on dbus (scan complete).
I have a problem though that when I issue any connman calls after I've initiated g_main_loop_run I get a crash.  If I issue any calls (for example GetProperties, Scan...), before I initiate the main loop, it functions just fine.   I don't have much of a stack trace to go on, but this is all I've got at this point:

#0  0xb7d71114 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#1  0xb7d6fbe7 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#2  0xb7d6fc5b in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#3  0xb7d6ee47 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#4  0xb7d6f727 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#5  0xb7d55803 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
#6  0xb7d563b2 in dbus_connection_get_dispatch_status () from /lib/i386-linux-gnu/libdbus-1.so.3
#7  0xb7d9df58 in ?? () from /usr/lib/i386-linux-gnu/libdbus-glib-1.so.2
#8  0xb7c339b3 in g_main_context_prepare () from /lib/i386-linux-gnu/libglib-2.0.so.0
#9  0xb7c342df in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#10 0xb7c3476b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#11 0x08051373 in NetworkOjbect::NetworkLoop () at NetworkOjbect.cpp:1054
#12 0xb7ad0f70 in start_thread (arg=0xb74ffb40) at pthread_create.c:312
#13 0xb7a0770e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

The entire function for NetworkLoop is as follows (again it's started in its own thread):

int NetworkOjbect::NetworkLoop(size_t)
{
    GMainLoop *pMainNetworkLoop;
    pMainNetworkLoop = g_main_loop_new(NULL, 0);
    if (!pMainNetworkLoop)
    {
        Trace("Could not start main network loop\n");
        exit(-1);
    }
    g_main_loop_run(pMainNetworkLoop);
    return(0);
}


Is there something with my logic in running the main loop in its own thread?  Is there a better way to debug this?  

Thanks for your input.

Tom


More information about the dbus mailing list