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 659022 - gtk_tree_model_filter_clear_cache_helper: assertion failed
gtk_tree_model_filter_clear_cache_helper: assertion failed
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
3.1.x
Other Linux
: Normal major
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
: 660571 662754 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-14 09:18 UTC by Guillaume Desmottes
Modified: 2011-10-26 11:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stand-alone test case which reliably reproduces the bug (10.38 KB, text/x-c)
2011-10-03 13:33 UTC, Kristian Rietveld
  Details
Patch set fixing the problem (3.34 KB, patch)
2011-10-03 15:48 UTC, Kristian Rietveld
none Details | Review

Description Guillaume Desmottes 2011-09-14 09:18:02 UTC
I hit this crash when changing my presence to offline using the Shell.

Gtk:ERROR:gtktreemodelfilter.c:1308:gtk_tree_model_filter_clear_cache_helper: assertion failed: (level)


  • #0 raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 abort
    at abort.c line 92
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at gtestutils.c line 1436
  • #4 gtk_tree_model_filter_clear_cache_helper
    at gtktreemodelfilter.c line 1308
  • #5 gtk_tree_model_filter_clear_cache
    at gtktreemodelfilter.c line 4303
  • #6 gtk_tree_model_filter_increment_stamp
    at gtktreemodelfilter.c line 1245
  • #7 gtk_tree_model_filter_row_deleted
    at gtktreemodelfilter.c line 2668
  • #8 g_cclosure_marshal_VOID__BOXED
  • #9 g_closure_invoke
    at gclosure.c line 773
  • #10 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #11 g_signal_emit_valist
    at gsignal.c line 3002
  • #12 g_signal_emit
    at gsignal.c line 3059
  • #13 gtk_tree_model_row_deleted
    at gtktreemodel.c line 1870
  • #14 gtk_tree_store_remove
    at gtktreestore.c line 1233
  • #15 individual_store_remove_individual
    at empathy-individual-store.c line 376
  • #16 individual_store_remove_individual_and_disconnect
    at empathy-individual-store.c line 988
  • #17 individual_store_members_changed_cb
    at empathy-individual-store.c line 1012
  • #18 _empathy_marshal_VOID__STRING_OBJECT_OBJECT_UINT
    at empathy-marshal.c line 361
  • #19 g_closure_invoke
    at gclosure.c line 773
  • #20 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #21 g_signal_emit_valist
    at gsignal.c line 3002
  • #22 g_signal_emit
    at gsignal.c line 3059
  • #23 individual_notify_personas_cb
    at empathy-individual-manager.c line 143
  • #24 g_cclosure_marshal_VOID__PARAM
    at gmarshal.c line 539
  • #25 g_closure_invoke
    at gclosure.c line 773
  • #26 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #27 g_signal_emit_valist
    at gsignal.c line 3002
  • #28 g_signal_emit
    at gsignal.c line 3059
  • #29 g_object_dispatch_properties_changed
    at gobject.c line 925
  • #30 g_object_notify_dispatcher
    at gobject.c line 331
  • #31 g_object_notify_queue_thaw
    at gobjectnotifyqueue.c line 132
  • #32 g_object_notify_by_spec_internal
    at gobject.c line 983
  • #33 g_object_notify
    at gobject.c line 1024
  • #34 folks_individual_set_personas
    at /home/cassidy/gnome/folks/folks/individual.vala line 681
  • #35 _folks_individual_aggregator_personas_changed_cb
    at /home/cassidy/gnome/folks/folks/individual-aggregator.vala line 1165
  • #36 __folks_individual_aggregator_personas_changed_cb_folks_persona_store_personas_changed
    at /home/cassidy/gnome/folks/folks/individual-aggregator.vala line 604
  • #37 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING_OBJECT_ENUM
    at /home/cassidy/gnome/folks/folks/persona-store.vala line 273
  • #38 g_closure_invoke
    at gclosure.c line 773
  • #39 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #40 g_signal_emit_valist
    at gsignal.c line 3002
  • #41 g_signal_emit_by_name
    at gsignal.c line 3096
  • #42 _folks_persona_store_emit_personas_changed
    at /home/cassidy/gnome/folks/folks/persona-store.vala line 376
  • #43 _tpf_persona_store_load_cache_co
    at /home/cassidy/gnome/folks/backends/telepathy/lib/tpf-persona-store.vala line 965
  • #44 _tpf_persona_store_load_cache_ready
    at /home/cassidy/gnome/folks/backends/telepathy/lib/tpf-persona-store.vala line 943
  • #45 g_simple_async_result_complete
    at gsimpleasyncresult.c line 749
  • #46 folks_object_cache_load_objects_co
    at /home/cassidy/gnome/folks/folks/object-cache.vala line 265
  • #47 folks_object_cache_load_objects_ready
    at /home/cassidy/gnome/folks/folks/object-cache.vala line 162
  • #48 g_simple_async_result_complete
    at gsimpleasyncresult.c line 749
  • #49 load_contents_close_callback
    at gfile.c line 6264
  • #50 async_ready_close_callback_wrapper
    at ginputstream.c line 484
  • #51 g_simple_async_result_complete
    at gsimpleasyncresult.c line 749
  • #52 complete_in_idle_cb_for_thread
    at gsimpleasyncresult.c line 816
  • #53 g_idle_dispatch
    at gmain.c line 4780
  • #54 g_main_dispatch
    at gmain.c line 2439
  • #55 g_main_context_dispatch
    at gmain.c line 3008
  • #56 g_main_context_iterate
    at gmain.c line 3086
  • #57 g_main_loop_run
    at gmain.c line 3294
  • #58 gtk_main
    at gtkmain.c line 1362
  • #59 gtk_application_run_mainloop
    at gtkapplication.c line 112
  • #60 g_application_run
    at gapplication.c line 1325
  • #61 main
    at empathy.c line 845

Comment 1 Guillaume Desmottes 2011-09-14 13:03:36 UTC
I never experienced this crash until I updated my GTK+ to master so I suspect this could be a GTK+ regression.
Comment 2 Kristian Rietveld 2011-09-17 03:27:19 UTC
Two questions:

  1) Is this assertion hit every time you try to set the presence to offline using the shell?  (i.e. is it reliably reproducible that way?)

  2) When did you update GTK+ to master / what is the HEAD commit you are running with?
Comment 3 Kristian Rietveld 2011-09-17 04:21:23 UTC
With question 2, I meant to verify whether you were at least running master from September 12.

The assertion you are hitting basically means that GtkTreeModelFilter's root level has been freed, however, the root zero_ref_count is still > 0 where it should be 0.  Likely, something is not being released properly somewhere or the zero_ref_count is being erroneously increased.

I will need more information to solve this problem, so I would like to request the following:

 - Update GTK+ master to today's top of tree (should include commit e1ede022f87e6fe7c2d4be29e61ce9be8866d24f).

 - In gtk/gtktreemodelfilter.c, enable MODEL_FILTER_DEBUG at line 328. This will enable more assertions.

 - Run Empathy against this GTK+ and give a backtrace of where it crashes.  It is very well possible it will crash at another place (hopefully where the faulty condition is introduced).

  - If it again crashes with gtk_tree_model_filter_row_deleted() in the stack, like frame #7 in trace 228443 which you provided, please include the following data from that exact frame:

print *filter->priv
print *elt
print *level

In general, this data is very useful also if you have another likewise function in your stack like gtk_tree_model_filter_row_inserted(), gtk_tree_model_filter_remove_elt_from_level(), etc.
Comment 4 Guillaume Desmottes 2011-09-19 08:15:30 UTC
(In reply to comment #2)
> Two questions:
> 
>   1) Is this assertion hit every time you try to set the presence to offline
> using the shell?  (i.e. is it reliably reproducible that way?)

No, it wasn't 100% reproducible.

>   2) When did you update GTK+ to master / what is the HEAD commit you are
> running with?

I updated my HEAD to 68e943506e411b0accce1fd0b6fa6eece23c4ac8 and still observed this bug. The trace was the same with MODEL_FILTER_DEBUG enabled.


(gdb) print *filter->priv
$1 = {child_model = 0x79ec80, root = 0x0, virtual_root = 0x0, stamp = 1906367665, child_flags = 1, zero_ref_count = 1, 
  visible_column = -1, visible_func = 0x4df568 <individual_view_filter_visible_func>, visible_data = 0xaf8060, 
  visible_destroy = 0, modify_types = 0x0, modify_func = 0, modify_data = 0x0, modify_destroy = 0, modify_n_columns = 0, 
  visible_method_set = 1, modify_func_set = 1, in_row_deleted = 0, virtual_root_deleted = 0, changed_id = 592, 
  inserted_id = 593, has_child_toggled_id = 594, deleted_id = 595, reordered_id = 596}
(gdb) print *elt
$2 = {iter = {stamp = 19475264, user_data = 0x0, user_data2 = 0x0, user_data3 = 0x0}, children = 0x0, offset = 0, 
  ref_count = 0, ext_ref_count = 0, zero_ref_count = 0, visible_siter = 0x1283800}
(gdb) print *level
$3 = {seq = 0x6f69747265737361, visible_seq = 0x64656c696166206e, ref_count = 1814569018, ext_ref_count = 1818588773, 
  parent_elt = 0x29, parent_level = 0x0}
Comment 5 Xavier Claessens 2011-09-19 08:25:21 UTC
priv->root is NULL and priv->zero_ref_count is 1, that shouldn't happen AFAIK. Surely a refcount issue somewhere... :/
Comment 6 Xavier Claessens 2011-09-19 08:32:16 UTC
When you enable MODEL_FILTER_DEBUG, are you sure the assert happens at the same place? Looking at code, it should assert sooner because it always verify that priv->zero_ref_count==0 when setting priv->root to NULL.
Comment 7 Guillaume Desmottes 2011-09-19 08:35:04 UTC
Humm sorry actually I wasn't testing with MODEL_FILTER_DEBUG. Here is the new trace:


Gtk:ERROR:gtktreemodelfilter.c:1012:gtk_tree_model_filter_free_level: assertion failed: (filter->priv->zero_ref_count == 0)

Program received signal SIGABRT, Aborted.
0x00007fffec6ebd05 in raise (sig=6) 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 full
  • #0 raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 abort
    at abort.c line 92
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at gtestutils.c line 1436
  • #4 gtk_tree_model_filter_free_level
    at gtktreemodelfilter.c line 1012
  • #5 gtk_tree_model_filter_row_deleted
    at gtktreemodelfilter.c line 2632
  • #6 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 574
  • #7 g_closure_invoke
    at gclosure.c line 773
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #9 g_signal_emit_valist
    at gsignal.c line 3002
  • #10 g_signal_emit
    at gsignal.c line 3059
  • #11 gtk_tree_model_row_deleted
    at gtktreemodel.c line 1870
  • #12 gtk_tree_store_remove
    at gtktreestore.c line 1233
  • #13 individual_store_remove_individual
    at empathy-individual-store.c line 374
  • #14 individual_store_remove_individual_and_disconnect
  • #15 individual_store_members_changed_cb
    at empathy-individual-store.c line 1010
  • #16 _empathy_marshal_VOID__STRING_OBJECT_OBJECT_UINT
    at empathy-marshal.c line 361
  • #17 g_closure_invoke
    at gclosure.c line 773
  • #18 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #19 g_signal_emit_valist
    at gsignal.c line 3002
  • #20 g_signal_emit
    at gsignal.c line 3059
  • #21 aggregator_individuals_changed_cb
    at empathy-individual-manager.c line 239
  • #22 g_cclosure_marshal_VOID__OBJECT
    at gmarshal.c line 644
  • #23 g_closure_invoke
    at gclosure.c line 773
  • #24 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #25 g_signal_emit_valist
    at gsignal.c line 3002
  • #26 g_signal_emit_by_name
    at gsignal.c line 3096
  • #27 _folks_individual_aggregator_emit_individuals_changed
    at /home/cassidy/gnome/folks/folks/individual-aggregator.vala line 765
  • #28 _folks_individual_aggregator_personas_changed_cb
    at /home/cassidy/gnome/folks/folks/individual-aggregator.vala line 1226
  • #29 __folks_individual_aggregator_personas_changed_cb_folks_persona_store_personas_changed
    at /home/cassidy/gnome/folks/folks/individual-aggregator.vala line 624
  • #30 g_cclosure_user_marshal_VOID__OBJECT_OBJECT_STRING_OBJECT_ENUM
    at /home/cassidy/gnome/folks/folks/persona-store.vala line 273
  • #31 g_closure_invoke
    at gclosure.c line 773
  • #32 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #33 g_signal_emit_valist
    at gsignal.c line 3002
  • #34 g_signal_emit_by_name
    at gsignal.c line 3096
  • #35 _folks_persona_store_emit_personas_changed
    at /home/cassidy/gnome/folks/folks/persona-store.vala line 376
  • #36 _tpf_persona_store_load_cache_co
    at /home/cassidy/gnome/folks/backends/telepathy/lib/tpf-persona-store.vala line 988
  • #37 _tpf_persona_store_load_cache_ready
    at /home/cassidy/gnome/folks/backends/telepathy/lib/tpf-persona-store.vala line 965
  • #38 g_simple_async_result_complete
    at gsimpleasyncresult.c line 749
  • #39 folks_object_cache_load_objects_co
    at /home/cassidy/gnome/folks/folks/object-cache.vala line 265
  • #40 folks_object_cache_load_objects_ready
    at /home/cassidy/gnome/folks/folks/object-cache.vala line 162
  • #41 g_simple_async_result_complete
    at gsimpleasyncresult.c line 749
  • #42 load_contents_close_callback
    at gfile.c line 6264
  • #43 async_ready_close_callback_wrapper
    at ginputstream.c line 484
  • #44 g_simple_async_result_complete
    at gsimpleasyncresult.c line 749
  • #45 complete_in_idle_cb_for_thread
    at gsimpleasyncresult.c line 816
  • #46 g_idle_dispatch
    at gmain.c line 4780
  • #47 g_main_dispatch
    at gmain.c line 2439
  • #48 g_main_context_dispatch
    at gmain.c line 3008
  • #49 g_main_context_iterate
    at gmain.c line 3086
  • #50 g_main_loop_run
    at gmain.c line 3294
  • #51 gtk_main
    at gtkmain.c line 1362
  • #52 gtk_application_run_mainloop
    at gtkapplication.c line 115
  • #53 g_application_run
    at gapplication.c line 1325
  • #54 main
    at empathy.c line 845

Comment 8 Guillaume Desmottes 2011-09-19 08:38:45 UTC
Oh, and I get those 2 warnings before the crash:

(empathy:9809): Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth > 0' failed

(empathy:9809): Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth > 0' failed
**
Comment 9 Guillaume Desmottes 2011-09-19 08:50:00 UTC
(In reply to comment #8)
> Oh, and I get those 2 warnings before the crash:
> 
> (empathy:9809): Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth >
> 0' failed
> 
> (empathy:9809): Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth >
> 0' failed
> **

May not be related actually. I just got the crash again without the warnings now.
Comment 10 Xavier Claessens 2011-09-19 09:18:16 UTC
I'm wondering if bug #659441 could have an influence on this, since it is related to removing rows too... But for what I understand of that code, it shouldn't be an issue.
Comment 11 Guillaume Desmottes 2011-09-19 09:46:20 UTC
(In reply to comment #10)
> I'm wondering if bug #659441 could have an influence on this, since it is
> related to removing rows too... But for what I understand of that code, it
> shouldn't be an issue.

Nope; I still got this bug with your fix.
Comment 12 Kristian Rietveld 2011-09-20 05:53:30 UTC
(In reply to comment #5)
> priv->root is NULL and priv->zero_ref_count is 1, that shouldn't happen AFAIK.
> Surely a refcount issue somewhere... :/

That is correct -- I pointed this out in comment 3.
Comment 13 Kristian Rietveld 2011-09-20 06:03:33 UTC
(In reply to comment #7)
> Gtk:ERROR:gtktreemodelfilter.c:1012:gtk_tree_model_filter_free_level: assertion
> failed: (filter->priv->zero_ref_count == 0)
> 
> Program received signal SIGABRT, Aborted.
> 0x00007fffec6ebd05 in raise (sig=6) at


So basically, we are missing a decrement of the zero ref count (or an increment too many) and this is affecting the clean up of the root level when the last node is removed.   I will think about a scenario in which this happen so we can set up a unit test.
Comment 14 Alban Crequy 2011-09-22 20:55:45 UTC
(In reply to comment #8)
> (empathy:9809): Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth >
> 0' failed

For the record, I filed Bug #659877 about this assertion.
Comment 15 Kristian Rietveld 2011-10-03 13:33:50 UTC
Created attachment 198085 [details]
stand-alone test case which reliably reproduces the bug

This is a stand-alone test case which reliably triggers the faulty condition.  The test case is basically a model of what EmpathyIndividualStore and EmpathyIndividualView are doing.

Now debugging ...
Comment 16 Kristian Rietveld 2011-10-03 15:48:18 UTC
Created attachment 198111 [details] [review]
Patch set fixing the problem

This patch set seems to solve the problems for me.  I will be writing stand-alone test cases for each separate fix before I will push this.

It would be appreciated if anyone is able to give this patch a try with the real empathy to see if the problem has indeed vanished.
Comment 17 Kristian Rietveld 2011-10-03 21:01:26 UTC
Pushed to master, will push to gtk-3-2 shortly.
Comment 18 Guillaume Desmottes 2011-10-08 15:16:14 UTC
Thanks, I'll update my GTK+ and let you know if I experience this bug again.
Comment 19 Guillaume Desmottes 2011-10-11 21:13:48 UTC
*** Bug 660571 has been marked as a duplicate of this bug. ***
Comment 20 Guillaume Desmottes 2011-10-26 11:36:49 UTC
*** Bug 662754 has been marked as a duplicate of this bug. ***