Skip to content

cm-utils: Check for non-null enc

Guido Gunther requested to merge guido.gunther/libcmatrix:non-null-enc into main

Otherwise we crash when passing NULL to cm_enc_find_file_enc_async

@mohammed.sadiq this is likely no the right fix but avoids a crash that otherwise looks like

1487	  file = g_hash_table_lookup (self->enc_files, uri);
(gdb) bt
#0  0x000055555562c9bb in cm_enc_find_file_enc_async (self=0x0, uri=0x7fffc008e370 "mxc://matrix.org/atWldDBZawwOiUZeGVriQfek", callback=0x555555648852 <find_file_enc_cb>, user_data=0x555555b36ee0)
    at ../subprojects/libcmatrix/src/cm-enc.c:1487
#1  0x0000555555648c88 in cm_utils_save_url_to_path_async
    (client=0x5555557967e0 [CmClient], uri=0x7fffc008e370 "mxc://matrix.org/atWldDBZawwOiUZeGVriQfek", file_path=0x555555f3a1b0 "/home/agx/.local/share/chatty/cmatrix/avatars/rooms/atWldDBZawwOiUZeGVriQfek", cancellable=0x0, progress_callback=0x0, progress_user_data=0x0, callback=0x55555563b264 <room_get_avatar_cb>, user_data=0x555555b06610) at ../subprojects/libcmatrix/src/cm-utils.c:1414
#2  0x000055555563b96f in cm_room_get_avatar_async (self=0x555555dc0de0 [CmRoom], cancellable=0x0, callback=0x5555555b2816 <ma_chat_get_avatar_cb>, user_data=0x555555e103d0)
    at ../subprojects/libcmatrix/src/cm-room.c:982
#3  0x00005555555b2a08 in chatty_ma_chat_get_avatar (item=0x555555e103d0 [ChattyMaChat]) at ../src/matrix/chatty-ma-chat.c:707
#4  0x00005555555e1479 in chatty_item_get_avatar (self=0x555555e103d0 [ChattyMaChat]) at ../src/users/chatty-item.c:542
#5  0x00005555555efd6e in avatar_changed_cb (self=0x555555f0b420 [ChattyAvatar]) at ../src/chatty-avatar.c:58
#6  0x00005555555f0427 in chatty_avatar_set_item (self=0x555555f0b420 [ChattyAvatar], item=0x555555e103d0 [ChattyMaChat]) at ../src/chatty-avatar.c:194
#7  0x00005555555e6820 in chatty_list_row_set_item (self=0x555555f04b40 [ChattyListRow], item=0x555555e103d0 [ChattyMaChat]) at ../src/chatty-list-row.c:386
#8  0x00005555555e666c in chatty_list_row_new (item=0x555555e103d0 [ChattyMaChat]) at ../src/chatty-list-row.c:341
#9  0x00007ffff7200315 in gtk_list_box_bound_model_changed (list=0x555555ad9700, position=<optimized out>, removed=<optimized out>, added=<optimized out>, user_data=0x555555a689b0)
    at ../../../gtk/gtklistbox.c:4010
#13 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555ad9700 [GtkFilterListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #10 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555a4b820, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffb4d0, invocation_hint=invocation_hint@entry=0x7fffffffb450)
    at ../../../gobject/gclosure.c:832
    #11 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555ad9700, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffb4d0)
    at ../../../gobject/gsignal.c:3796
    #12 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffb6a0) at ../../../gobject/gsignal.c:3549
#14 0x00005555555d6742 in gtk_filter_list_model_items_changed_cb (model=0x555555ad9600, position=0, removed=0, added=24, self=0x555555ad9700 [GtkFilterListModel]) at ../src/contrib/gtkfilterlistmodel.c:350
#18 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555ad9600 [GtkFilterListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #15 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555ad0330, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffb980, invocation_hint=invocation_hint@entry=0x7fffffffb900)
    at ../../../gobject/gclosure.c:832
    #16 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555ad9600, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffb980)
    at ../../../gobject/gsignal.c:3796
    #17 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffbb50) at ../../../gobject/gsignal.c:3549
#19 0x00005555555d6742 in gtk_filter_list_model_items_changed_cb (model=0x5555557455c0, position=0, removed=0, added=24, self=0x555555ad9600 [GtkFilterListModel]) at ../src/contrib/gtkfilterlistmodel.c:350
#23 0x00007ffff7c588ef in <emit signal ??? on instance 0x5555557455c0 [GtkFilterListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #20 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555a4ba00, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffbe30, invocation_hint=invocation_hint@entry=0x7fffffffbdb0)
    at ../../../gobject/gclosure.c:832
    #21 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x5555557455c0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffbe30)
    at ../../../gobject/gsignal.c:3796
    #22 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc000) at ../../../gobject/gsignal.c:3549
#24 0x00005555555d6742 in gtk_filter_list_model_items_changed_cb (model=0x555555745500, position=0, removed=0, added=24, self=0x5555557455c0 [GtkFilterListModel]) at ../src/contrib/gtkfilterlistmodel.c:350
#28 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555745500 [GtkSortListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #25 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555749310, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffc2e0, invocation_hint=invocation_hint@entry=0x7fffffffc260)
    at ../../../gobject/gclosure.c:832
    #26 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555745500, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc2e0)
    at ../../../gobject/gsignal.c:3796
    #27 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc4b0) at ../../../gobject/gsignal.c:3549
--Type <RET> for more, q to quit, c to continue without paging--
#29 0x00005555555d878d in gtk_sort_list_model_items_changed_cb (model=0x7fffe4009af0, position=0, removed=0, added=24, self=0x555555745500 [GtkSortListModel]) at ../src/contrib/gtksortlistmodel.c:252
#33 0x00007ffff7c588ef in <emit signal ??? on instance 0x7fffe4009af0 [GtkFlattenListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #30 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555747650, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffc780, invocation_hint=invocation_hint@entry=0x7fffffffc700)
    at ../../../gobject/gclosure.c:832
    #31 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x7fffe4009af0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc780)
    at ../../../gobject/gsignal.c:3796
    #32 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc950) at ../../../gobject/gsignal.c:3549
#34 0x00005555555d33e8 in gtk_flatten_list_model_items_changed_cb (model=0x5555558b0c40, position=0, removed=0, added=24, _node=0x5555557ba360) at ../src/contrib/gtkflattenlistmodel.c:249
#38 0x00007ffff7c588ef in <emit signal ??? on instance 0x5555558b0c40 [GtkFlattenListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #35 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x5555559203b0, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffcc30, invocation_hint=invocation_hint@entry=0x7fffffffcbb0)
    at ../../../gobject/gclosure.c:832
    #36 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x5555558b0c40, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcc30)
    at ../../../gobject/gsignal.c:3796
    #37 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffce00) at ../../../gobject/gsignal.c:3549
#39 0x00005555555d33e8 in gtk_flatten_list_model_items_changed_cb (model=0x555555e4e780, position=0, removed=0, added=24, _node=0x555555e4ea20) at ../src/contrib/gtkflattenlistmodel.c:249
#43 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555e4e780 [GListStore]> (instance=<optimized out>, signal_id=<optimized out>, detail=detail@entry=0) at ../../../gobject/gsignal.c:3606
    #40 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x5555557b58b0, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffd0e0, invocation_hint=invocation_hint@entry=0x7fffffffd060)
    at ../../../gobject/gclosure.c:832
    #41 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555e4e780, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd0e0)
    at ../../../gobject/gsignal.c:3796
    #42 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd2b0) at ../../../gobject/gsignal.c:3549
#44 0x00007ffff7d54a8f in g_list_model_items_changed (list=<optimized out>, position=position@entry=0, removed=removed@entry=0, added=added@entry=24) at ../../../gio/glistmodel.c:321
#45 0x00007ffff7d54d20 in g_list_store_items_changed (store=0x555555e4e780 [GListStore], position=0, removed=0, added=24) at ../../../gio/gliststore.c:92
#46 0x00005555555ae386 in joined_rooms_changed (self=0x555555df02e0 [ChattyMaAccount], position=0, removed=0, added=24, model=0x555555e4e8c0) at ../src/matrix/chatty-ma-account.c:667
#50 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555e4e8c0 [GListStore]> (instance=<optimized out>, signal_id=<optimized out>, detail=detail@entry=0) at ../../../gobject/gsignal.c:3606
    #47 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x5555557b4c50, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffd5c0, invocation_hint=invocation_hint@entry=0x7fffffffd540)
    at ../../../gobject/gclosure.c:832
    #48 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555e4e8c0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd5c0)
    at ../../../gobject/gsignal.c:3796
    #49 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd790) at ../../../gobject/gsignal.c:3549
#51 0x00007ffff7d54a8f in g_list_model_items_changed (list=<optimized out>, position=position@entry=0, removed=removed@entry=0, added=added@entry=24) at ../../../gio/glistmodel.c:321
#52 0x00007ffff7d54d20 in g_list_store_items_changed (store=0x555555e4e8c0 [GListStore], position=0, removed=0, added=24) at ../../../gio/gliststore.c:92
#53 0x0000555555613f44 in db_load_client_cb (obj=0x555555e4eac0 [CmDb], result=0x555555b066d0, user_data=0x555555c06840) at ../subprojects/libcmatrix/src/cm-client.c:960
#54 0x00007ffff7d3e6f9 in g_task_return_now (task=task@entry=0x555555b066d0 [GTask]) at ../../../gio/gtask.c:1232
#55 0x00007ffff7d3e739 in complete_in_idle_cb (task=0x555555b066d0) at ../../../gio/gtask.c:1246
#56 0x00007ffff7b4566f in g_main_dispatch (context=0x555555711c50) at ../../../glib/gmain.c:3444
#57 g_main_context_dispatch (context=context@entry=0x555555711c50) at ../../../glib/gmain.c:4162
#58 0x00007ffff7b45a28 in g_main_context_iterate (context=context@entry=0x555555711c50, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4238
#59 0x00007ffff7b45abc in g_main_context_iteration (context=context@entry=0x555555711c50, may_block=may_block@entry=1) at ../../../glib/gmain.c:4303
#60 0x00007ffff7d6debd in g_application_run (application=0x5555557100f0 [ChattyApplication], argc=<optimized out>, argv=<optimized out>) at ../../../gio/gapplication.c:2571
#61 0x00005555555903cf in main (argc=1, argv=0x7fffffffdc28) at ../src/main.c:84
(gdb) bt
#0  0x000055555562c9bb in cm_enc_find_file_enc_async (self=0x0, uri=0x7fffc008e370 "mxc://matrix.org/atWldDBZawwOiUZeGVriQfek", callback=0x555555648852 <find_file_enc_cb>, user_data=0x555555b36ee0)
    at ../subprojects/libcmatrix/src/cm-enc.c:1487
#1  0x0000555555648c88 in cm_utils_save_url_to_path_async
    (client=0x5555557967e0 [CmClient], uri=0x7fffc008e370 "mxc://matrix.org/atWldDBZawwOiUZeGVriQfek", file_path=0x555555f3a1b0 "/home/agx/.local/share/chatty/cmatrix/avatars/rooms/atWldDBZawwOiUZeGVriQfek", cancellable=0x0, progress_callback=0x0, progress_user_data=0x0, callback=0x55555563b264 <room_get_avatar_cb>, user_data=0x555555b06610) at ../subprojects/libcmatrix/src/cm-utils.c:1414
#2  0x000055555563b96f in cm_room_get_avatar_async (self=0x555555dc0de0 [CmRoom], cancellable=0x0, callback=0x5555555b2816 <ma_chat_get_avatar_cb>, user_data=0x555555e103d0)
    at ../subprojects/libcmatrix/src/cm-room.c:982
#3  0x00005555555b2a08 in chatty_ma_chat_get_avatar (item=0x555555e103d0 [ChattyMaChat]) at ../src/matrix/chatty-ma-chat.c:707
#4  0x00005555555e1479 in chatty_item_get_avatar (self=0x555555e103d0 [ChattyMaChat]) at ../src/users/chatty-item.c:542
#5  0x00005555555efd6e in avatar_changed_cb (self=0x555555f0b420 [ChattyAvatar]) at ../src/chatty-avatar.c:58
#6  0x00005555555f0427 in chatty_avatar_set_item (self=0x555555f0b420 [ChattyAvatar], item=0x555555e103d0 [ChattyMaChat]) at ../src/chatty-avatar.c:194
#7  0x00005555555e6820 in chatty_list_row_set_item (self=0x555555f04b40 [ChattyListRow], item=0x555555e103d0 [ChattyMaChat]) at ../src/chatty-list-row.c:386
#8  0x00005555555e666c in chatty_list_row_new (item=0x555555e103d0 [ChattyMaChat]) at ../src/chatty-list-row.c:341
#9  0x00007ffff7200315 in gtk_list_box_bound_model_changed (list=0x555555ad9700, position=<optimized out>, removed=<optimized out>, added=<optimized out>, user_data=0x555555a689b0)
    at ../../../gtk/gtklistbox.c:4010
#13 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555ad9700 [GtkFilterListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #10 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555a4b820, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffb4d0, invocation_hint=invocation_hint@entry=0x7fffffffb450)
    at ../../../gobject/gclosure.c:832
    #11 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555ad9700, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffb4d0)
    at ../../../gobject/gsignal.c:3796
    #12 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffb6a0) at ../../../gobject/gsignal.c:3549
#14 0x00005555555d6742 in gtk_filter_list_model_items_changed_cb (model=0x555555ad9600, position=0, removed=0, added=24, self=0x555555ad9700 [GtkFilterListModel]) at ../src/contrib/gtkfilterlistmodel.c:350
#18 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555ad9600 [GtkFilterListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #15 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555ad0330, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffb980, invocation_hint=invocation_hint@entry=0x7fffffffb900)
    at ../../../gobject/gclosure.c:832
    #16 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555ad9600, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffb980)
    at ../../../gobject/gsignal.c:3796
    #17 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffbb50) at ../../../gobject/gsignal.c:3549
#19 0x00005555555d6742 in gtk_filter_list_model_items_changed_cb (model=0x5555557455c0, position=0, removed=0, added=24, self=0x555555ad9600 [GtkFilterListModel]) at ../src/contrib/gtkfilterlistmodel.c:350
#23 0x00007ffff7c588ef in <emit signal ??? on instance 0x5555557455c0 [GtkFilterListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #20 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555a4ba00, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffbe30, invocation_hint=invocation_hint@entry=0x7fffffffbdb0)
    at ../../../gobject/gclosure.c:832
    #21 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x5555557455c0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffbe30)
    at ../../../gobject/gsignal.c:3796
    #22 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc000) at ../../../gobject/gsignal.c:3549
#24 0x00005555555d6742 in gtk_filter_list_model_items_changed_cb (model=0x555555745500, position=0, removed=0, added=24, self=0x5555557455c0 [GtkFilterListModel]) at ../src/contrib/gtkfilterlistmodel.c:350
#28 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555745500 [GtkSortListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #25 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555749310, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffc2e0, invocation_hint=invocation_hint@entry=0x7fffffffc260)
    at ../../../gobject/gclosure.c:832
    #26 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555745500, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc2e0)
    at ../../../gobject/gsignal.c:3796
    #27 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc4b0) at ../../../gobject/gsignal.c:3549
--Type <RET> for more, q to quit, c to continue without paging--
#29 0x00005555555d878d in gtk_sort_list_model_items_changed_cb (model=0x7fffe4009af0, position=0, removed=0, added=24, self=0x555555745500 [GtkSortListModel]) at ../src/contrib/gtksortlistmodel.c:252
#33 0x00007ffff7c588ef in <emit signal ??? on instance 0x7fffe4009af0 [GtkFlattenListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #30 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x555555747650, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffc780, invocation_hint=invocation_hint@entry=0x7fffffffc700)
    at ../../../gobject/gclosure.c:832
    #31 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x7fffe4009af0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc780)
    at ../../../gobject/gsignal.c:3796
    #32 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffc950) at ../../../gobject/gsignal.c:3549
#34 0x00005555555d33e8 in gtk_flatten_list_model_items_changed_cb (model=0x5555558b0c40, position=0, removed=0, added=24, _node=0x5555557ba360) at ../src/contrib/gtkflattenlistmodel.c:249
#38 0x00007ffff7c588ef in <emit signal ??? on instance 0x5555558b0c40 [GtkFlattenListModel]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../../../gobject/gsignal.c:3606
    #35 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x5555559203b0, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffcc30, invocation_hint=invocation_hint@entry=0x7fffffffcbb0)
    at ../../../gobject/gclosure.c:832
    #36 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x5555558b0c40, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcc30)
    at ../../../gobject/gsignal.c:3796
    #37 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffce00) at ../../../gobject/gsignal.c:3549
#39 0x00005555555d33e8 in gtk_flatten_list_model_items_changed_cb (model=0x555555e4e780, position=0, removed=0, added=24, _node=0x555555e4ea20) at ../src/contrib/gtkflattenlistmodel.c:249
#43 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555e4e780 [GListStore]> (instance=<optimized out>, signal_id=<optimized out>, detail=detail@entry=0) at ../../../gobject/gsignal.c:3606
    #40 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x5555557b58b0, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffd0e0, invocation_hint=invocation_hint@entry=0x7fffffffd060)
    at ../../../gobject/gclosure.c:832
    #41 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555e4e780, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd0e0)
    at ../../../gobject/gsignal.c:3796
    #42 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd2b0) at ../../../gobject/gsignal.c:3549
#44 0x00007ffff7d54a8f in g_list_model_items_changed (list=<optimized out>, position=position@entry=0, removed=removed@entry=0, added=added@entry=24) at ../../../gio/glistmodel.c:321
#45 0x00007ffff7d54d20 in g_list_store_items_changed (store=0x555555e4e780 [GListStore], position=0, removed=0, added=24) at ../../../gio/gliststore.c:92
#46 0x00005555555ae386 in joined_rooms_changed (self=0x555555df02e0 [ChattyMaAccount], position=0, removed=0, added=24, model=0x555555e4e8c0) at ../src/matrix/chatty-ma-account.c:667
#50 0x00007ffff7c588ef in <emit signal ??? on instance 0x555555e4e8c0 [GListStore]> (instance=<optimized out>, signal_id=<optimized out>, detail=detail@entry=0) at ../../../gobject/gsignal.c:3606
    #47 0x00007ffff7c3e500 in g_closure_invoke
    (closure=0x5555557b4c50, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fffffffd5c0, invocation_hint=invocation_hint@entry=0x7fffffffd540)
    at ../../../gobject/gclosure.c:832
    #48 0x00007ffff7c51ba6 in signal_emit_unlocked_R
    (node=node@entry=0x55555572f780, detail=detail@entry=0, instance=instance@entry=0x555555e4e8c0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd5c0)
    at ../../../gobject/gsignal.c:3796
    #49 0x00007ffff7c58725 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd790) at ../../../gobject/gsignal.c:3549
#51 0x00007ffff7d54a8f in g_list_model_items_changed (list=<optimized out>, position=position@entry=0, removed=removed@entry=0, added=added@entry=24) at ../../../gio/glistmodel.c:321
#52 0x00007ffff7d54d20 in g_list_store_items_changed (store=0x555555e4e8c0 [GListStore], position=0, removed=0, added=24) at ../../../gio/gliststore.c:92
#53 0x0000555555613f44 in db_load_client_cb (obj=0x555555e4eac0 [CmDb], result=0x555555b066d0, user_data=0x555555c06840) at ../subprojects/libcmatrix/src/cm-client.c:960
#54 0x00007ffff7d3e6f9 in g_task_return_now (task=task@entry=0x555555b066d0 [GTask]) at ../../../gio/gtask.c:1232
#55 0x00007ffff7d3e739 in complete_in_idle_cb (task=0x555555b066d0) at ../../../gio/gtask.c:1246
#56 0x00007ffff7b4566f in g_main_dispatch (context=0x555555711c50) at ../../../glib/gmain.c:3444
#57 g_main_context_dispatch (context=context@entry=0x555555711c50) at ../../../glib/gmain.c:4162
#58 0x00007ffff7b45a28 in g_main_context_iterate (context=context@entry=0x555555711c50, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4238
#59 0x00007ffff7b45abc in g_main_context_iteration (context=context@entry=0x555555711c50, may_block=may_block@entry=1) at ../../../glib/gmain.c:4303
#60 0x00007ffff7d6debd in g_application_run (application=0x5555557100f0 [ChattyApplication], argc=<optimized out>, argv=<optimized out>) at ../../../gio/gapplication.c:2571
#61 0x00005555555903cf in main (argc=1, argv=0x7fffffffdc28) at ../src/main.c:84

With this change I see a bunch of

19:35:00.3388             cm-utils[190115]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'cm_client_get_enc (client)' failed
19:35:00.3426             cm-utils[190115]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'cm_client_get_enc (client)' failed
19:35:00.3433             cm-utils[190115]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'cm_client_get_enc (client)' failed
19:35:00.3439             cm-utils[190115]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'cm_client_get_enc (client)' failed
19:35:02.2635             cm-utils[190115]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'cm_client_get_enc (client)' failed
19:35:02.7566             cm-utils[190115]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'cm_client_get_enc (client)' failed
19:35:03.0218             cm-utils[190115]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'cm_client_get_enc (client)' failed

and no encrypted rooms but it doesn't crash.

Merge request reports