[Telepathy] [Bug 16774] New: TpConnectionManager idle callback not cancelled on destroy

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 18 05:36:49 PDT 2008


http://bugs.freedesktop.org/show_bug.cgi?id=16774

           Summary: TpConnectionManager idle callback not cancelled on
                    destroy
           Product: Telepathy
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: ASSIGNED
          Severity: normal
          Priority: medium
         Component: telepathy-glib
        AssignedTo: telepathy at lists.freedesktop.org
        ReportedBy: simon.mcvittie at collabora.co.uk


As reported by iain^ on IRC, TpConnectionManager fails to cancel an idle when
destroyed, resulting in this crash.

#include <telepathy-glib/dbus.h>
#include <telepathy-glib/connection-manager.h>

DBusGConnection *conn;

TpDBusDaemon *tp_conn;

static void
list_cm (TpConnectionManager * const *cms,
         gsize                        n_cms,
         const GError                *error,
         gpointer                     userdata,
         GObject                     *weak_object)
{
        int i;

        g_print ("Got %d connection managers\n", n_cms);
        for (i = 0; i < n_cms; i++) {
                TpConnectionManager *cm = cms[i];

                g_print ("[%d] %s\n", i + 1, cm->name);

                if (cm->info_source > TP_CM_INFO_SOURCE_NONE) {
                        int j;

                        for (j = 0; cm->protocols[j]; j++) {
                                const TpConnectionManagerProtocol *p =
cm->protocols[j];
                                g_print ("   (%d) %s\n", j + 1, p->name);
                        }
                }
        }
}

int
main (int    argc,
      char **argv)
{
        GMainLoop *mainloop;

        g_type_init ();

        conn = tp_get_bus ();
        tp_conn = tp_dbus_daemon_new (conn);

        tp_list_connection_managers (tp_conn, list_cm, NULL, NULL, NULL);

        mainloop = g_main_loop_new (NULL, FALSE);
        g_main_loop_run (mainloop);
}

-----
# ./tp-test
Got 2 connection managers
[1] gabble
[2] sofiasip

(process:13565): GLib-GObject-WARNING **: invalid uninstantiatable type
`<invalid>' in cast to `TpConnectionManager'
Segmentation fault

Program received signal SIGSEGV, Segmentation fault.
0x4007bb5e in tp_connection_manager_idle_read_manager_file (data=0x8058808)
    at connection-manager.c:808
808       if (self->priv->protocols == NULL && self->priv->manager_file != NULL
(gdb) bt
#0  0x4007bb5e in tp_connection_manager_idle_read_manager_file (data=0x8058808)
    at connection-manager.c:808
#1  0x4027ddf1 in g_idle_dispatch (source=0x80590c0, 
    callback=0x403179c8 <g_threads_got_initialized>, user_data=0x8058808)
    at gmain.c:4171
#2  0x4027f9fc in IA__g_main_context_dispatch (context=0x8051668)
    at gmain.c:2066
#3  0x40282e5f in g_main_context_iterate (context=0x8051668, block=1, 
    dispatch=1, self=0x8053000) at gmain.c:2699
#4  0x40283209 in IA__g_main_loop_run (loop=0x8051510) at gmain.c:2922
#5  0x080487a3 in main () at main.c:48


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Telepathy mailing list