Bug 25538

Summary: telepathy-gabble crash if disconnect is called while connecting
Product: Telepathy Reporter: Nicolas Dufresne <nicolas>
Component: gabbleAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: major    
Priority: medium CC: sjoerd
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Valgrind log produced during crash
GDB Backtrace on crash
Valgrind log (with glib debug symboles)
Don't unref result on established_session_recv()
WOCKY_DEBUG=connector,xmpp-reader,xmpp-writer,net on gabble crash
GABBLE_DEBUG=all WOCKY_DEBUG=connector,xmpp-reader,xmpp-writer,net

Description Nicolas Dufresne 2009-12-09 08:36:12 UTC
Created attachment 31883 [details]
Valgrind log produced during crash

It looks like gabble crash if disconnect is called while connection state is connecting.

telepathy-gabble: git 7acfe00ef6fb90e236c81aaf4c215cc52af079e9
empathy: 2.28.1.2

Step to reproduce:
1. Hook gdb to telepathy-gabble process
2. Open Empathy and configure two jabber accounts
3. Connect one of the two account
4. In the second accound UI, quickly check and uncheck the enable checkbox

Expected result:
The second account should move from DISCONNECTED to CONNECTING and then from CONNECTING to DISCONNECTED.

Observed result:
gabble crash, all accounts get disconnected.
Comment 1 Nicolas Dufresne 2009-12-09 08:37:29 UTC
Created attachment 31884 [details]
GDB Backtrace on crash
Comment 2 Nicolas Dufresne 2009-12-09 10:56:45 UTC
Created attachment 31891 [details]
Valgrind log (with glib debug symboles)
Comment 3 Nicolas Dufresne 2009-12-10 13:55:10 UTC
Created attachment 31948 [details] [review]
Don't unref result on established_session_recv()

Can also be fetched from http://git.collabora.co.uk/?p=user/nicolas/wocky.git;a=summary commit ad74940243a72afcbd02f03e21842b7a34f5a5ae .
Comment 4 Nicolas Dufresne 2009-12-11 08:57:27 UTC
From Sjoerd (added to CC) I've got told my fix is wrong. I've tested for leaks, corruption or regression (wocky tests) and there was nothing different, except it does not crash. Sjoerd should explain why it's wrong. To me, my fix is wrong in the sense that it does not fix the circular dependency, but workaround it by delaying an unref.

Also, for those just getting in, note that just adding the missing, priv->result = NULL does not fix the problem since the result and self get unrefed by other mean I don't understand atm.
Comment 5 Nicolas Dufresne 2009-12-11 09:57:13 UTC
Created attachment 31991 [details]
WOCKY_DEBUG=connector,xmpp-reader,xmpp-writer,net on gabble crash
Comment 6 Nicolas Dufresne 2009-12-11 10:03:44 UTC
Created attachment 31992 [details]
GABBLE_DEBUG=all WOCKY_DEBUG=connector,xmpp-reader,xmpp-writer,net

GABBLE_DEBUG=all WOCKY_DEBUG=connector,xmpp-reader,xmpp-writer,net
What was done:
1. Connect collabora account, wait to finish
2. Connect google account
3. disconnct google account (before it's finished)
Comment 7 Sjoerd Simons 2009-12-21 06:54:36 UTC
This should be fixed in current git by virtue of some fixes in wocky, please test 
Comment 8 Nicolas Dufresne 2010-01-06 14:10:43 UTC
I confirm this is fixed with latest wocky.

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.