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 670523 - persona.vala:153:folks_persona_get_individual: assertion failed: (_tmp6_)
persona.vala:153:folks_persona_get_individual: assertion failed: (_tmp6_)
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
: 671148 671641 672352 673358 675120 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-02-21 09:51 UTC by Guillaume Desmottes
Modified: 2012-04-30 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: Don’t modify a HashSet while iterating over it (2.94 KB, patch)
2012-03-05 00:18 UTC, Philip Withnall
committed Details | Review

Description Guillaume Desmottes 2012-02-21 09:51:56 UTC
I got this crash while disconnecting my XMPP accounts. I was using Folks master.


folks:ERROR:/home/cassidy/gnome/folks/folks/persona.vala:153:folks_persona_get_individual: assertion failed: (_tmp6_)

  • #0 __GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 __GI_abort
    at abort.c line 91
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at gtestutils.c line 1871
  • #4 folks_persona_get_individual
    at /home/cassidy/gnome/folks/folks/persona.vala line 153
  • #5 _folks_individual_disconnect_from_persona
    at /home/cassidy/gnome/folks/folks/individual.vala line 1625
  • #6 _folks_individual_set_personas
    at /home/cassidy/gnome/folks/folks/individual.vala line 1972
  • #7 folks_individual_set_personas
    at /home/cassidy/gnome/folks/folks/individual.vala line 799
  • #8 _folks_individual_aggregator_personas_changed_cb
    at /home/cassidy/gnome/folks/folks/individual-aggregator.vala line 1323
  • #9 __folks_individual_aggregator_personas_changed_cb_folks_persona_store_personas_changed
    at /home/cassidy/gnome/folks/folks/individual-aggregator.vala line 736
  • #10 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING_OBJECT_ENUM
    at /home/cassidy/gnome/folks/folks/persona-store.vala line 281
  • #11 g_closure_invoke
    at gclosure.c line 774
  • #12 signal_emit_unlocked_R
    at gsignal.c line 3302
  • #13 g_signal_emit_valist
    at gsignal.c line 3033
  • #14 g_signal_emit_by_name
    at gsignal.c line 3127
  • #15 _folks_persona_store_emit_personas_changed
    at /home/cassidy/gnome/folks/folks/persona-store.vala line 395
  • #16 _tpf_persona_store_load_cache_co
    at /home/cassidy/gnome/folks/backends/telepathy/lib/tpf-persona-store.vala line 1091
  • #17 _tpf_persona_store_load_cache_ready
    at /home/cassidy/gnome/folks/backends/telepathy/lib/tpf-persona-store.vala line 1067
  • #18 g_simple_async_result_complete
    at gsimpleasyncresult.c line 744
  • #19 folks_object_cache_load_objects_co
    at /home/cassidy/gnome/folks/folks/object-cache.vala line 313
  • #20 folks_object_cache_load_objects_ready
    at /home/cassidy/gnome/folks/folks/object-cache.vala line 197
  • #21 g_simple_async_result_complete
    at gsimpleasyncresult.c line 744
  • #22 load_contents_close_callback
    at gfile.c line 6325
  • #23 async_ready_close_callback_wrapper
    at ginputstream.c line 484
  • #24 g_simple_async_result_complete
    at gsimpleasyncresult.c line 744
  • #25 complete_in_idle_cb_for_thread
    at gsimpleasyncresult.c line 812
  • #26 g_idle_dispatch
    at gmain.c line 4629
  • #27 g_main_dispatch
    at gmain.c line 2510
  • #28 g_main_context_dispatch
    at gmain.c line 3047
  • #29 g_main_context_iterate
    at gmain.c line 3118
  • #30 g_main_context_iteration
    at gmain.c line 3179
  • #31 g_application_run
    at gapplication.c line 1496
  • #32 main
    at empathy-chat.c line 166

Comment 1 Philip Withnall 2012-02-24 09:23:25 UTC
Can you reproduce this? If so, it would be good to call folks_debug_emit_print_status(folks_debug_dup()) (from gdb) just before causing the crash. This crash should only happen if a Persona is removed from an Individual it was never in — which should never happen.
Comment 2 Guillaume Desmottes 2012-02-24 09:50:58 UTC
Yeah, it happens pretty often when I suspend my laptop while being online. I'll try to reproduce and provide the info.
Comment 3 Guillaume Desmottes 2012-02-29 09:16:15 UTC
I just sent you the output of this command once I hit the crash. Not sure how to catch it just before it.
Comment 4 Guillaume Desmottes 2012-03-02 08:51:08 UTC
*** Bug 671148 has been marked as a duplicate of this bug. ***
Comment 5 Bilal Shahid 2012-03-02 11:54:20 UTC
duplicated bug has also the stacktrace i wish that would help 
https://launchpadlibrarian.net/94067284/Stacktrace.txt
Comment 6 Philip Withnall 2012-03-04 22:25:13 UTC
Guillaume, would it be possible for you to reproduce the crash again and get a *correlated* set of debug info? I need:
 • the logs from FOLKS_DEBUG=all G_MESSAGES_DEBUG=all;
 • the folks_debug_emit_print_status() stuff in gdb; and
 • the backtrace from gdb.

(Basically, I need the memory addresses to match between them so I can figure out what's going on.)

From the two stacktraces so far, I've got a theory that the IndividualAggregator's link map is pointing to Individual A, which contains Persona 1 in its set of personas. However, somehow Individual B has claimed ownership of Persona 1, and also has Persona 1 in its set of personas. Persona 1's individual pointer is pointing at Individual B — so when Individual A iterates over its set of personas, it triggers the assertion when it reaches Persona 1.
Comment 7 Philip Withnall 2012-03-05 00:18:50 UTC
Created attachment 208967 [details] [review]
core: Don’t modify a HashSet while iterating over it

Alternatively, here’s a patch which might fix the problem. (It certainly fixes _a_ bug.) We were iterating over a set, removing elements of the set by calling iter.remove() as we go. This should’ve been fine, but bug #671327 meant it wasn’t, and we were potentially skipping some elements of the set. This patch works around bug #671327.

Guillaume, could you please give this a go and see if it fixes your crash? If it doesn’t, I’ll need the debug information listed in comment #6.

https://www.gitorious.org/folks/folks/commits/670523-individual-persona-assertion
Comment 8 Guillaume Desmottes 2012-03-05 07:54:30 UTC
(In reply to comment #7)
> Guillaume, could you please give this a go and see if it fixes your crash? If
> it doesn’t, I’ll need the debug information listed in comment #6.

Sure, I'm now running it. It uses to happen quiet a lot so if it didn't crash during the next few days I think we'll be good.
Comment 9 Guillaume Desmottes 2012-03-06 08:45:08 UTC
Reproduced. I sent you all the info by mail.
Comment 10 Guillaume Desmottes 2012-03-08 15:32:28 UTC
*** Bug 671641 has been marked as a duplicate of this bug. ***
Comment 11 Xavier Claessens 2012-03-12 12:18:20 UTC
with attachment #208967 [details], notify::is-quiescent is never emitted it seems. Patch applied on top of current folks master.
Comment 12 Bilal Shahid 2012-03-14 13:42:16 UTC
also present in downstream
https://bugs.launchpad.net/ubuntu/+source/empathy/+bug/944418
Comment 13 Guillaume Desmottes 2012-03-19 08:35:06 UTC
*** Bug 672352 has been marked as a duplicate of this bug. ***
Comment 14 Guillaume Desmottes 2012-03-19 13:46:43 UTC
Review of attachment 208967 [details] [review]:

++
Comment 15 Philip Withnall 2012-03-19 13:50:33 UTC
Comment on attachment 208967 [details] [review]
core: Don’t modify a HashSet while iterating over it

commit 46d4506d346199f53039d8d31275b8ce61146528
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Mon Mar 5 00:11:09 2012 +0000

    core: Don’t modify a HashSet while iterating over it
    
    Even though we were modifying it from the Iterator (which should’ve been OK),
    we got hit by https://bugzilla.gnome.org/show_bug.cgi?id=671327 which meant
    that some Personas weren't getting disconnected from Individuals. This is a
    likely cause of bug #670523.
    
    This also includes a related (but irrelevant to the bug itself) tidy-up to
    Persona._individual.
    
    Closes: https://bugzilla.gnome.org/show_bug.cgi?id=670523

 NEWS                  |    2 ++
 folks/individual.vala |   11 ++++++-----
 folks/persona.vala    |    4 ++--
 3 files changed, 10 insertions(+), 7 deletions(-)
Comment 16 Philip Withnall 2012-03-19 13:51:15 UTC
Guillaume can no longer reproduce the bug with this patch and the one from bug #672381, so let's close this.
Comment 17 Guillaume Desmottes 2012-04-02 14:01:24 UTC
*** Bug 673358 has been marked as a duplicate of this bug. ***
Comment 18 Philip Withnall 2012-04-30 13:46:22 UTC
*** Bug 675120 has been marked as a duplicate of this bug. ***