Critical warning/potential segfault in thunar_standard_view_update_statusbar_text_idle
Version information
4.20.0+315+gb7393e15e
Steps to reproduce
I don't know how to reproduce this, it's a crash (SIGTRAP
, G_DEBUG=fatal-criticals
) that happened yesterday without me noticing, and I got the report this morning.
Backtrace
mars 22 19:16:14 pc thunar.orig[21064]: IA__xfce_icon_view_get_selected_items: assertion 'XFCE_IS_ICON_VIEW (icon_view)' failed
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0 _g_log_abort (breakpoint=<optimized out>) at ../glib/glib/gmessages.c:431
431 G_BREAKPOINT ();
[Current thread is 1 (Thread 0x75cec259fa40 (LWP 21064))]
(gdb) bt
#0 _g_log_abort (breakpoint=<optimized out>) at ../glib/glib/gmessages.c:431
#1 g_logv (log_domain=0x75cec3b14015 "libxfce4ui", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7ffc3f64f2e0) at ../glib/glib/gmessages.c:1287
#2 0x000075cec464fb54 in g_log (log_domain=log_domain@entry=0x75cec3b14015 "libxfce4ui", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x75cec471836b "%s: assertion '%s' failed")
at ../glib/glib/gmessages.c:1329
#3 0x000075cec4650e2e in g_return_if_fail_warning
(log_domain=log_domain@entry=0x75cec3b14015 "libxfce4ui", pretty_function=pretty_function@entry=0x75cec3b19680 <__func__.49> "IA__xfce_icon_view_get_selected_items", expression=expression@entry=0x75cec3b15eb9 "XFCE_IS_ICON_VIEW (icon_view)") at ../glib/glib/gmessages.c:3074
#4 0x000075cec3b06757 in IA__xfce_icon_view_get_selected_items (icon_view=<optimized out>) at ../libxfce4ui/xfce-icon-view.c:6181
#5 0x000061f16e5208f0 in thunar_standard_view_update_statusbar_text_idle (data=0x61f183654d80) at ../thunar/thunar-standard-view.c:2475
#6 thunar_standard_view_update_statusbar_text_idle (data=0x61f183654d80) at ../thunar/thunar-standard-view.c:2453
#7 0x000075cec464b58a in g_timeout_dispatch (source=source@entry=0x61f183671080, callback=<optimized out>, user_data=<optimized out>) at ../glib/glib/gmain.c:5111
#8 0x000075cec464a104 in g_main_dispatch (context=0x61f1830729c0) at ../glib/glib/gmain.c:3398
#9 0x000075cec46add57 in g_main_context_dispatch_unlocked (context=0x61f1830729c0) at ../glib/glib/gmain.c:4249
#10 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x61f1830729c0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4314
#11 0x000075cec4649535 in g_main_context_iteration (context=context@entry=0x61f1830729c0, may_block=may_block@entry=1) at ../glib/glib/gmain.c:4379
#12 0x000075cec4882756 in g_application_run (application=0x61f183086960 [ThunarApplication], argc=<optimized out>, argv=<optimized out>) at ../glib/gio/gapplication.c:2715
#13 0x000061f16e4b7118 in main (argc=2, argv=0x7ffc3f64f798) at ../thunar/main.c:86
The critical warning appears on line 2475 instead of 2461, because I'm building thunar with --buildtype=minsize
, i.e. with NDEBUG
set, and therefore with _thunar_return_val_if_fail
disabled. I don't know if it's a great idea to disable these functions, regardless of the debug level, but that's another question.
Since the handling of priv->statusbar_text_idle_id
is correct, it looks like this crash is happening because thunar_standard_view_update_statusbar_text
is called after standard_view
has been finalized. From there there are multiple possible calls (including external ones in thunar-window.c
), and I haven't investigated further.