figure out sort key caching
This happens when opening the inspector in gtk4-demo, going to the global tab, resource page, and clicking on the size header:
#0 0x00007ffff6d409e5 in raise () at /lib64/libc.so.6
#1 0x00007ffff6d29895 in abort () at /lib64/libc.so.6
#2 0x00007ffff7645e3c in g_assertion_message
(domain=<optimized out>, file=0x7ffff7c5cc50 "../gtk/gtktreelistrowsorter.c", line=<optimized out>, func=<optimized out>, message=<optimized out>)
at ../glib/gtestutils.c:2936
#3 0x00007ffff76a0c8b in g_assertion_message_expr
(domain=domain@entry=0x7ffff7bfe21e "Gtk", file=file@entry=0x7ffff7c5cc50 "../gtk/gtktreelistrowsorter.c", line=line@entry=115, func=func@entry=0x7ffff7c5ce00 <__func__.5> "gtk_tree_list_row_sort_keys_free", expr=expr@entry=0x7ffff7c5cc88 "g_hash_table_size (self->cached_keys) == 0") at ../glib/gtestutils.c:2962
#4 0x00007ffff7a1ce47 in gtk_tree_list_row_sort_keys_free (keys=0x21e1e60)
at ../gtk/gtktreelistrowsorter.c:115
#5 gtk_tree_list_row_sort_keys_free (keys=0x21e1e60)
at ../gtk/gtktreelistrowsorter.c:111
#6 0x00007ffff79c0c9c in gtk_sort_list_model_sorter_changed_cb
(sorter=<optimized out>, change=<optimized out>, self=0x21e4000 [GtkSortListModel]) at ../gtk/gtksortlistmodel.c:716
#7 0x00007ffff75e5fca in g_cclosure_marshal_VOID__BOOLEANv
(closure=<optimized out>, return_value=<optimized out>, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x1b7fed0) at ../gobject/gmarshal.c:272
#8 0x00007ffff75e412e in _g_closure_invoke_va
(closure=closure@entry=0x1812740, return_value=return_value@entry=0x0, instance=instance@entry=0x21e02d0, args=args@entry=0x7fffffffccd8, n_params=1, param_types=0x1b7fed0) at ../gobject/gclosure.c:873
#9 0x00007ffff75fbf7e in g_signal_emit_valist
(instance=0x21e02d0, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffccd8) at ../gobject/gsignal.c:3403
#10 0x00007ffff75fc162 in g_signal_emit
(instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>)
at ../gobject/gsignal.c:3550
#11 0x00007ffff75e5fca in g_cclosure_marshal_VOID__BOOLEANv
(closure=<optimized out>, return_value=<optimized out>, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x1b7fed0) at ../gobject/gmarshal.c:272
#12 0x00007ffff75e412e in _g_closure_invoke_va
(closure=closure@entry=0x21dc3a0, return_value=return_value@entry=0x0, instance=instance@entry=0x1d0a6a0, args=args@entry=0x7fffffffcfc8, n_params=1, param_types=0x1b7fed0) at ../gobject/gclosure.c:873
After bandaid fixes, it no longer crashes, at the cost of regenerating all the keys. We should figure out how to avoid that.
Edited by Matthias Clasen