[Bug 40557] New: Crash in gabble_roster_request_subscription_added_cb() because the connection is NULL

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 1 18:06:04 CEST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=40557

           Summary: Crash in gabble_roster_request_subscription_added_cb()
                    because the connection is NULL
           Product: Telepathy
           Version: git master
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: gabble
        AssignedTo: telepathy-bugs at lists.freedesktop.org
        ReportedBy: marco.barisione at collabora.co.uk
         QAContact: telepathy-bugs at lists.freedesktop.org


I got this stacktrace (without steps to reproduce):
#0      tp_handle_inspect(self=0x0, handle=12)
#1      gabble_roster_request_subscription_added_cb(source=0x1a2848,
user_data=0x249d00)
#2      g_simple_async_result_complete(...)

On the terminal we get:
GLIB DEBUG default - send_iq_async failed: Error receiving data: Network is
unreachable
GLIB CRITICAL ** tp-glib - tp_base_connection_get_handles: assertion
`TP_IS_BASE_CONNECTION (self)' failed

What seems to happen is that we get disconnected, the connection goes away and
it's null in the gabble_roster_request_subscription_added_cb() callback. Other
similar callbacks in roster.c have a check for self->priv->conn not being NULL.

What I don't understand at all is how self->priv->conn can actually become
NULL. It's set in the constructed() method and then never changed again, not
even in dispose()/finalize():

static void
gabble_roster_constructed (GObject *obj)
{
  [...]

  /* FIXME: This is not a strong reference because that would create a cycle.
   * I'd like to have a cyclic reference and break it at disconnect time,
   * like the contact list example in telepathy-glib does, but we can't do
   * that because the rest of Gabble assumes that the roster remains useful
   * until the bitter end (for instance, gabble_im_channel_dispose looks
   * at the contact's subscription). */
  self->priv->conn = GABBLE_CONNECTION (tp_base_contact_list_get_connection (
        base, NULL));
  g_assert (GABBLE_IS_CONNECTION (self->priv->conn));

  [...]
}

Note that the GAsyncResult passed to
gabble_roster_request_subscription_added_cb() holds a reference to self, so it
should not have been deleted in the meantime.

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



More information about the telepathy-bugs mailing list