Bug 35328

Summary: SegFault в xfce4-appfinder (was: Окошко по Alt-F2 почти сразу закрывается)
Product: Sisyphus Reporter: Vitaly Lipatov <lav>
Component: xfce4-appfinderAssignee: Mikhail Efremov <sem>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P3 CC: cas, oddity, sem
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
desktop-файл, с которым падает xfce4-appfinder none

Description Vitaly Lipatov 2018-09-01 14:01:47 MSK
Нажимаем Alt-F2, появляется окно запуска команды, которое через секунду закрывается с большим количеством одинаковых сообщений в консоль
(xfce4-appfinder:8275): GLib-CRITICAL **: 14:00:38.106: g_utf8_casefold: assertion 'str != NULL' failed

(xfce4-appfinder:8275): GLib-CRITICAL **: 14:00:38.106: g_utf8_casefold: assertion 'str != NULL' failed

(xfce4-appfinder:8275): GLib-CRITICAL **: 14:00:38.107: g_utf8_casefold: assertion 'str != NULL' failed


(xfce4-appfinder:7481): GLib-CRITICAL **: 13:58:27.755: g_utf8_collate: assertion 'str2 != NULL' failed
(xfce4-appfinder:7481): GLib-CRITICAL **: 13:58:27.755: g_utf8_collate: assertion 'str1 != NULL' failed

xfce4-appfinder-4.13.1-alt1.x86_64
Comment 1 Vitaly Lipatov 2018-09-02 21:47:57 MSK
Нашёл что-то похожее:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=756770

Наконец дошло, что это Segfault. Запустил через gdb и получил:

Program received signal SIGSEGV, Segmentation fault.
0x0000003da1680c03 in _g_utf8_normalize_wc (str=0x0, max_len=max_len@entry=-1, mode=mode@entry=G_NORMALIZE_ALL) at gunidecomp.c:372
372	  while ((max_len < 0 || p < str + max_len) && *p)
(gdb) bt
#0  0x0000003da1680c03 in _g_utf8_normalize_wc (str=0x0, max_len=max_len@entry=-1, mode=mode@entry=G_NORMALIZE_ALL) at gunidecomp.c:372
#1  0x0000003da168113b in g_utf8_normalize (str=<optimized out>, len=len@entry=-1, mode=mode@entry=G_NORMALIZE_ALL) at gunidecomp.c:533
#2  0x0000000000412065 in xfce_appfinder_window_sort_items (model=0x87f950, a=0x7fffffffd3c0, b=0x7fffffffd3e0, data=<optimized out>) at appfinder-window.c:1954
#3  0x00007ffff77be76e in gtk_tree_model_sort_compare_func (a=<optimized out>, b=<optimized out>, user_data=0x7fffffffd520) at gtktreemodelsort.c:1842
#4  0x0000003da1667c6d in node_find_closest (haystack=0x9f5530, needle=needle@entry=0xa12e00, end=0x745130, iter_cmp=iter_cmp@entry=0x3da16678f0 <iter_compare>, cmp_data=cmp_data@entry=0x7fffffffd4c0)
    at gsequence.c:1799
#5  0x0000003da16680fe in node_insert_sorted (node=<optimized out>, new=new@entry=0xa12e00, end=<optimized out>, iter_cmp=iter_cmp@entry=0x3da16678f0 <iter_compare>, cmp_data=cmp_data@entry=0x7fffffffd4c0)
    at gsequence.c:2037
#6  0x0000003da1669004 in g_sequence_insert_sorted_iter (seq=0x8a9790, data=<optimized out>, iter_cmp=iter_cmp@entry=0x3da16678f0 <iter_compare>, cmp_data=cmp_data@entry=0x7fffffffd4c0) at gsequence.c:1050
#7  0x0000003da16690c8 in g_sequence_insert_sorted (seq=<optimized out>, data=data@entry=0xa13040, cmp_func=cmp_func@entry=0x7ffff77be710 <gtk_tree_model_sort_compare_func>, cmp_data=<optimized out>)
    at gsequence.c:740
#8  0x00007ffff77c17a9 in gtk_tree_model_sort_insert_value (s_iter=0x7fffffffd500, s_path=0x788d80, level=0x8a7650, tree_model_sort=0x869e50) at gtktreemodelsort.c:2074
#9  gtk_tree_model_sort_row_inserted (s_model=<optimized out>, s_path=0x788d80, s_iter=<optimized out>, data=0x869e50) at gtktreemodelsort.c:971
#10 0x0000003da1a109ed in g_closure_invoke (closure=0x89ad10, return_value=0x0, n_param_values=3, param_values=0x7fffffffd750, invocation_hint=0x7fffffffd6f0) at gclosure.c:804
#11 0x0000003da1a231ce in signal_emit_unlocked_R (node=node@entry=0x7fffe800ded0, detail=detail@entry=0, instance=instance@entry=0x87f950, emission_return=emission_return@entry=0x0, 
    instance_and_params=instance_and_params@entry=0x7fffffffd750) at gsignal.c:3635
#12 0x0000003da1a2b7b5 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd928) at gsignal.c:3391
#13 0x0000003da1a2c182 in g_signal_emit (instance=instance@entry=0x87f950, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
#14 0x00007ffff77b7e70 in gtk_tree_model_row_inserted (tree_model=tree_model@entry=0x87f950, path=path@entry=0x788d80, iter=iter@entry=0x7fffffffda10) at gtktreemodel.c:1855
#15 0x00007ffff77bd241 in gtk_tree_model_filter_emit_row_inserted_for_path (filter=filter@entry=0x87f950, c_model=c_model@entry=0x6d8b40, c_path=c_path@entry=0x786000, c_iter=c_iter@entry=0x7d1300)
    at gtktreemodelfilter.c:1954
#16 0x00007ffff77bd933 in gtk_tree_model_filter_row_inserted (c_model=0x6d8b40, c_path=0x786000, c_iter=0x7d1300, data=0x87f950) at gtktreemodelfilter.c:2283
#17 0x0000003da1a109ed in g_closure_invoke (closure=0x89b100, return_value=0x0, n_param_values=3, param_values=0x7fffffffdd30, invocation_hint=0x7fffffffdcd0) at gclosure.c:804
#18 0x0000003da1a231ce in signal_emit_unlocked_R (node=node@entry=0x7fffe800ded0, detail=detail@entry=0, instance=instance@entry=0x6d8b40, emission_return=emission_return@entry=0x0, 
    instance_and_params=instance_and_params@entry=0x7fffffffdd30) at gsignal.c:3635
#19 0x0000003da1a2b7b5 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffdf08) at gsignal.c:3391
#20 0x0000003da1a2c182 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
#21 0x00007ffff77b7e70 in gtk_tree_model_row_inserted (tree_model=<optimized out>, path=path@entry=0x786000, iter=iter@entry=0x7fffffffdfe0) at gtktreemodel.c:1855
#22 0x000000000040df18 in xfce_appfinder_model_collect_idle (user_data=<optimized out>) at appfinder-model.c:757
#23 0x00007ffff71c6700 in gdk_threads_dispatch (data=0x7ab560) at gdk.c:743
#24 0x0000003da164ee35 in g_main_dispatch (context=0x65f270) at gmain.c:3176
#25 g_main_context_dispatch (context=context@entry=0x65f270) at gmain.c:3829
#26 0x0000003da164f1d8 in g_main_context_iterate (context=0x65f270, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3902
#27 0x0000003da164f4e2 in g_main_loop_run (loop=0x8ce6a0) at gmain.c:4098
#28 0x00007ffff76af385 in gtk_main () at gtkmain.c:1323
#29 0x0000000000409e73 in main (argc=<optimized out>, argv=<optimized out>) at main.c:313
(gdb)
Comment 2 Vitaly Lipatov 2018-09-02 22:07:34 MSK
xfce_appfinder_window_sort_items вызывает g_utf8_normalize для нулевого указателя здесь:


1953	  gtk_tree_model_get (model, b, XFCE_APPFINDER_MODEL_COLUMN_TITLE, &title_b, -1);
1954	  normalized = g_utf8_normalize (title_b, -1, G_NORMALIZE_ALL);
1955	  title_b = g_utf8_casefold (normalized, -1);
1956	  g_free (normalized);

После (gdb) break appfinder-window.c:1954 if title_b == 0
обнаружилось
(gdb) print title_a
$2 = (gchar *) 0xa10c00 "audacity"
(gdb) print title_b
$3 = (gchar *) 0x0

b - это итератор по GtkTreeIter

https://developer.gnome.org/gtk3/3.20/GtkTreeModel.html#gtk-tree-model-get
Comment 3 Vitaly Lipatov 2018-09-02 22:58:24 MSK
Created attachment 7731 [details]
desktop-файл, с которым падает xfce4-appfinder

Скорее всего, воспроизводится только у меня из-за какого-то левого desktop-файла.
Я даже нашёл его и прикладываю.

Завёл багу в апстриме
https://bugzilla.xfce.org/show_bug.cgi?id=14655
Comment 4 Repository Robot 2018-09-04 22:48:12 MSK
xfce4-appfinder-4.13.1-alt2 -> sisyphus:

Tue Sep 04 2018 Mikhail Efremov <sem@altlinux> 4.13.1-alt2
- Ignore menu items without name (closes: #35328).