Bug 35430 - Crash when disconnecting during authentication
Summary: Crash when disconnecting during authentication
Status: RESOLVED FIXED
Alias: None
Product: Wocky
Classification: Unclassified
Component: General (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/ba...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-18 10:32 UTC by Marco Barisione
Modified: 2011-03-18 11:05 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Marco Barisione 2011-03-18 10:32:42 UTC
The SASL authentication code can assert in wocky_auth_registry_success_async_func() (priv->handler is NULL) if we get disconnected while authenticating. What I think is happening is:
* sasl_auth_stanza_sent() is called;
* this calles wocky_xmpp_connection_recv_stanza_async() passing
  sasl_auth_stanza_received() as callback;
* the connection gets disconnected;
* cleanup happens;
* after this we still receive the stanza;
* sasl_auth_stanza_received is called;
* we handle the stanze, but things go wrong as we already did the cleanup.
Comment 1 Marco Barisione 2011-03-18 10:43:27 UTC
Branch ready for review. Senko is working on a test for this in the meantime.
Comment 2 Will Thompson 2011-03-18 10:56:38 UTC
It'd be nice to move this new check to after the “is it a stream error?” check, so that we don't throw away information.

(In existing code, wocky_xmpp_connection_recv_stanza_finish() is called right before stream_error(), and no GError ** is passed into it. So we throw away a perfectly good error, and then synthesise a new, content-free one…)

But functionally, your analysis seems sensible, and this should fix that bug.
Comment 3 Will Thompson 2011-03-18 11:05:57 UTC
I've merged the fixed version of the patch; thanks! <http://cgit.freedesktop.org/wocky/commit/?id=683d2cf1c5d4095b9413442d4cafb4e850c47952>


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.