Bug 35430

Summary: Crash when disconnecting during authentication
Product: Wocky Reporter: Marco Barisione <marco.barisione>
Component: GeneralAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: senko.rasic
Version: git master   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/bari/wocky.git;a=shortlog;h=refs/heads/sasl-auth-crash
Whiteboard:
i915 platform: i915 features:

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.