Bug 40557 - Crash in gabble_roster_request_subscription_added_cb() because the connection is NULL
Summary: Crash in gabble_roster_request_subscription_added_cb() because the connection...
Status: NEW
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-01 09:06 UTC by Marco Barisione
Modified: 2011-09-01 09:06 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Barisione 2011-09-01 09:06:03 UTC
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.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.