After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660140 - contacts_contact_find_persona_from_store: assertion `store != NULL' failed
contacts_contact_find_persona_from_store: assertion `store != NULL' failed
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: e-d-s backend
git master
Other Linux
: Normal normal
: gnome-3.2
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2011-09-26 14:30 UTC by Guillaume Desmottes
Modified: 2011-09-26 22:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fall back to the "system" address book as the default, in case one isn't set (2.10 KB, patch)
2011-09-26 17:35 UTC, Travis Reitter
reviewed Details | Review
Fall back to the "system" address book as the default, in case one isn't set (try 2) (2.17 KB, patch)
2011-09-26 21:45 UTC, Travis Reitter
accepted-commit_now Details | Review

Description Guillaume Desmottes 2011-09-26 14:30:40 UTC
I clicked on a Jabber contact, select 'Edit' and hit:

** CRITICAL **: contacts_contact_find_persona_from_store: assertion `store != NULL' failed

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff16fb66c in g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_CRITICAL, format=0x7ffff17836b8 "%s: assertion `%s' failed", 
    args1=0x7fffffffbc20) at gmessages.c:570
570			G_BREAKPOINT ();
(gdb) bt
  • #0 g_logv
    at gmessages.c line 570
  • #1 g_log
    at gmessages.c line 591
  • #2 g_return_if_fail_warning
    at gmessages.c line 600
  • #3 contacts_contact_find_persona_from_store
    at contacts-contact.c line 4788
  • #4 contacts_contact_find_primary_persona
    at contacts-contact.c line 4850
  • #5 contacts_fake_persona_maybe_create_for
    at contacts-contact.c line 6369
  • #6 contacts_contact_pane_update_persona_buttons
    at contacts-contact-pane.c line 6681
  • #7 contacts_contact_pane_display_edit
    at contacts-contact-pane.c line 7194
  • #8 __lambda63_
    at contacts-contact-pane.c line 9242
  • #9 ___lambda63__gtk_button_clicked
    at contacts-contact-pane.c line 9247
  • #10 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #11 g_closure_invoke
    at gclosure.c line 774
  • #12 signal_emit_unlocked_R
    at gsignal.c line 3272
  • #13 g_signal_emit_valist
    at gsignal.c line 3003
  • #14 g_signal_emit
    at gsignal.c line 3060
  • #15 gtk_button_clicked
    at gtkbutton.c line 1196
  • #16 gtk_real_button_released
    at gtkbutton.c line 1825
  • #17 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #18 g_type_class_meta_marshal
    at gclosure.c line 885
  • #19 g_closure_invoke
    at gclosure.c line 774
  • #20 signal_emit_unlocked_R
    at gsignal.c line 3202
  • #21 g_signal_emit_valist
    at gsignal.c line 3003
  • #22 g_signal_emit
    at gsignal.c line 3060
  • #23 gtk_button_released
    at gtkbutton.c line 1182
  • #24 gtk_button_button_release
    at gtkbutton.c line 1717
  • #25 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #26 g_type_class_meta_marshal
    at gclosure.c line 885
  • #27 g_closure_invoke
    at gclosure.c line 774
  • #28 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #29 g_signal_emit_valist
    at gsignal.c line 3013
  • #30 g_signal_emit
    at gsignal.c line 3060
  • #31 gtk_widget_event_internal
    at gtkwidget.c line 6131
  • #32 gtk_widget_event
    at gtkwidget.c line 5847
  • #33 gtk_propagate_event
    at gtkmain.c line 2614
  • #34 gtk_main_do_event
    at gtkmain.c line 1889
  • #35 _gdk_event_emit
    at gdkevents.c line 71
  • #36 gdk_event_source_dispatch
    at gdkeventsource.c line 360
  • #37 g_main_dispatch
    at gmain.c line 2441
  • #38 g_main_context_dispatch
    at gmain.c line 3011
  • #39 g_main_context_iterate
    at gmain.c line 3089
  • #40 g_main_loop_run
    at gmain.c line 3297
  • #41 gtk_main
    at gtkmain.c line 1362
  • #42 gtk_application_run_mainloop
    at gtkapplication.c line 115
  • #43 g_application_run
    at gapplication.c line 1323
  • #44 _vala_main
    at main.c line 76
  • #45 main
    at main.c line 87

Comment 1 Guillaume Desmottes 2011-09-26 15:16:22 UTC
Marking my only evo abook as default in evolution solved this. Could be an Evolution or folks bug; one of them could consider the only abook as the default one.
Comment 2 Travis Reitter 2011-09-26 17:35:39 UTC
Created attachment 197499 [details] [review]
Fall back to the "system" address book as the default, in case one isn't set

Patch from branch:

http://cgit.collabora.com/git/user/treitter/folks.git/log/?h=bgo660140-missing-default
Comment 3 Philip Withnall 2011-09-26 17:41:52 UTC
Review of attachment 197499 [details] [review]:

Some really minor comments.

::: backends/eds/lib/edsf-persona-store.vala
@@ +1951,3 @@
+       * "default" property, we include EDS's fallback logic for the "system"
+       * address book */
+      E.SourceList sources;

This could be moved inside the try block, I think.

@@ +1963,3 @@
         {
+          /* Translators: the first parameter is error message. */
+          warning (_("failed to get the set of ESources while looking for a default address book: %s"), e);

Warnings don't need to be translated. s/failed/Failed/.
Comment 4 Travis Reitter 2011-09-26 21:45:07 UTC
Created attachment 197515 [details] [review]
Fall back to the "system" address book as the default, in case one isn't set (try 2)

Patch from branch:

http://cgit.collabora.com/git/user/treitter/folks.git/log/?h=bgo660140-missing-default
Comment 5 Philip Withnall 2011-09-26 21:53:03 UTC
Review of attachment 197515 [details] [review]:

::: backends/eds/lib/edsf-persona-store.vala
@@ +1948,3 @@
       bool is_default = false;
+
+      E.SourceList sources;

Still outside the try block!

@@ +1956,3 @@
+          E.BookClient.get_sources (out sources);
+          var default_source = sources.peek_default_source ();
+          if (default_source != null &&

When can default_source be null? Should we manually fall back to “system” in this case? (You've probably thought of this, so I'm fine for this to be committed if that's the case.)
Comment 6 Travis Reitter 2011-09-26 22:58:01 UTC
(In reply to comment #5)
> Review of attachment 197515 [details] [review]:
> 
> ::: backends/eds/lib/edsf-persona-store.vala
> @@ +1948,3 @@
>        bool is_default = false;
> +
> +      E.SourceList sources;
> 
> Still outside the try block!

Whoops! Fixed.

> @@ +1956,3 @@
> +          E.BookClient.get_sources (out sources);
> +          var default_source = sources.peek_default_source ();
> +          if (default_source != null &&
> 
> When can default_source be null? Should we manually fall back to “system” in
> this case? (You've probably thought of this, so I'm fine for this to be
> committed if that's the case.)

If you check out the source in EDS, "system" is included as a fallback default in the logic for peek_default_source(). We were skipping this logic before because we were just checking if the property "default" was true (and it isn't true for the "system" address book in most cases; it only is if the user set it as such through gconf-editor (the UI to do this in Evo was recently stripped, it seems)).
Comment 7 Travis Reitter 2011-09-26 22:58:18 UTC
commit 506baeb119df6a2288754dbbb9ce48a802e0e82b
Author: Travis Reitter <travis.reitter@collabora.co.uk>
Date:   Mon Sep 26 15:44:47 2011 -0700

    More-tightly scope variable in EDS backend.

 backends/eds/lib/edsf-persona-store.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

commit cbf4373f265914e179d64457f74d209f28beffdd
Author: Travis Reitter <travis.reitter@collabora.co.uk>
Date:   Mon Sep 26 09:44:39 2011 -0700

    Actually fall back to eds:system in case there's no default address book.
    
    Closes: bgo#660140 - contacts_contact_find_persona_from_store: assertion `st
    != NULL' failed

 NEWS                                     |    2 ++
 backends/eds/lib/edsf-persona-store.vala |   20 ++++++++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)