dbus causing seg fault in compilation

pete-c pcwhizzkid at hotmail.com
Tue Jun 2 09:50:39 PDT 2009


Hi,
I'm trying to use dbus to monitor distcc compilations - at the moment just
passing files and which host is compiling them to my gobject on dbus. All I
have added to the distcc code is a call to the function below, yet when it
runs I often get errors coming up (depending on the packages that I'm
compiling) but usually a segmentation error, also saying there are
unfinished tasks.

I realise this isn't much info to go on, but as I only have a limited
knowledge base in dbus, I'd be grateful if anyone could point out if there
are any obvious mistakes I've made, or nuances with dbus I might have
overlooked, so that I could have a clearer idea of where the problem
is/isn't coming from.
Many thanks.

void dbus_send_file(char *hostname, char *filename) 
{
        DBusGConnection *connection;
        DBusGProxy *proxy = NULL;
        GError *error = NULL;

        g_type_init ();


        // Get the connection and ensure the name is not used yet
        connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
        if (connection == NULL) {
                g_warning ("Failed to make connection to session bus: %s",
                           error->message);
                g_error_free (error);
                exit(1);
        }

        proxy = dbus_g_proxy_new_for_name (     connection, 
                                                "org.distcc.DistccTracker",
                                                "/Object",
                                               
"org.distcc.DistccTrackerIFace" );


        error = NULL;

        if(!org_distcc_DistccTrackerIFace_add_file(proxy, hostname,
filename, &error))
        {
                printf("ERROR: Could not call proxy method.\n");
                return;
        }

        if(error!=NULL) {
                g_warning ("Error: %s",
                            error->message);
                g_error_free (error);
                return;      
        }

        g_object_unref(proxy);
        return;
}



(PS - I'm aware of the existance of distccmon-gnome and text which do
themselves moniter the compilations, but I'm currently trying to make a
custom version, which would link in with a webpage).
-- 
View this message in context: http://www.nabble.com/dbus-causing-seg-fault-in-compilation-tp23836487p23836487.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.



More information about the dbus mailing list