Bug 27686 - contact: should check if TP_CONNECTION_FEATURE_CAPABILITIES has actually be prepared
Summary: contact: should check if TP_CONNECTION_FEATURE_CAPABILITIES has actually be p...
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (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/ca...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-04-16 03:26 UTC by Guillaume Desmottes
Modified: 2010-04-16 05:49 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Guillaume Desmottes 2010-04-16 03:26:38 UTC
Checking if tp_proxy_prepare_finish returned TRUE is not enough. As TP_CONNECTION_FEATURE_CAPABILITIES is not a core feature, _finish can return TRUE event if the feature hasn't actually be prepared.

This can lead to this kind of crash if tp-glib can't fetch RCC:


GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed
aborting...

Program received signal SIGABRT, Aborted.
0x00007fffeea274b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	../nptl/sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
	in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x00007fffeea274b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007fffeea2af50 in *__GI_abort () at abort.c:92
#2  0x00007fffeeda8e0a in IA__g_logv (log_domain=<value optimized out>, log_level=<value optimized out>, format=<value optimized out>, 
    args1=0x7fffffffdcf0) at /build/buildd/glib2.0-2.22.3/glib/gmessages.c:549
#3  0x00007fffeeda8ea3 in IA__g_log (log_domain=0x6de5 <Address 0x6de5 out of bounds>, log_level=28133, 
    format=0x6 <Address 0x6 out of bounds>) at /build/buildd/glib2.0-2.22.3/glib/gmessages.c:569
#4  0x00007fffef23d682 in IA__g_object_ref (_object=<value optimized out>) at /build/buildd/glib2.0-2.22.3/gobject/gobject.c:2384
#5  0x00007ffff56adeab in contact_set_capabilities (self=0x108d740, capabilities=0x0) at contact.c:1557
#6  0x00007ffff56aece0 in set_conn_capabilities_on_contacts (object=<value optimized out>, res=<value optimized out>, 
    user_data=0x108d0c0) at contact.c:1751
#7  connection_capabilities_prepare_cb (object=<value optimized out>, res=<value optimized out>, user_data=0x108d0c0) at contact.c:1771
#8  0x00007fffef4c47b9 in complete_in_idle_cb (data=0x6de5) at /build/buildd/glib2.0-2.22.3/gio/gsimpleasyncresult.c:598
#9  0x00007fffeed9ebce in g_main_dispatch (context=0x8f0860) at /build/buildd/glib2.0-2.22.3/glib/gmain.c:1960
#10 IA__g_main_context_dispatch (context=0x8f0860) at /build/buildd/glib2.0-2.22.3/glib/gmain.c:2513
#11 0x00007fffeeda2598 in g_main_context_iterate (context=0x8f0860, block=<value optimized out>, dispatch=<value optimized out>, 
    self=<value optimized out>) at /build/buildd/glib2.0-2.22.3/glib/gmain.c:2591
#12 0x00007fffeeda29f5 in IA__g_main_loop_run (loop=0x956210) at /build/buildd/glib2.0-2.22.3/glib/gmain.c:2799
#13 0x00007ffff11d1177 in IA__gtk_main () at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c:1218
#14 0x0000000000440475 in main (argc=1, argv=0x7fffffffe308) at empathy.c:735
Comment 2 Simon McVittie 2010-04-16 05:14:25 UTC
The patch looks good, but I wonder if a better way to handle this would be to have TpConnection "successfully" report an empty set of capabilities if the connection doesn't have Requests.

Tricky semantic rationale: if the connection doesn't have Requests, then there is nothing you can pass to CreateChannel/EnsureChannel, so by definition the set of requestable channel classes is empty :-)
Comment 3 Guillaume Desmottes 2010-04-16 05:37:33 UTC
Make sense. I added a patch doing that but I think the other one still make sense any way.
Comment 4 Simon McVittie 2010-04-16 05:38:06 UTC
I added some patches to your branch, what do you think of this?

http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/caps-crash-27686
Comment 5 Simon McVittie 2010-04-16 05:49:32 UTC
Fixed for 0.11.3 using a combination of our branches. Teamwork! :-)

(This bug was in code that has never been in a release, so no need to backport.)


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.