! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[BACKTRACE] GVFS/SFTP crashes thunar because of bad character encoding
Status:
RESOLVED: FIXED

Comments

Description Harald Judt 2012-10-15 14:13:26 CEST
Thunar crashes when trying to access directories or files via gvfs that have encoding problems.

Setting:
I connect to a network resource via sftp://user@some-server.com/some/dir. This is a network resource that is also available via a samba share, and connecting it via CIFS shows all filenames correctly. However, when accessing the resource via gvfs sftp, gvfs reports some files with foreign characters as "f�lename (invalid encoding)". � is a question mark on dark background, in case the bug tracker swallows this character.

Now this may be a problem with gvfs, but still thunar shouldn't crash. What's more, I can only reproduce the crash when using thunar in daemon mode, not when it is launched in non-daemon mode.

Here is the backtrace I get with "gdb --args thunar --daemon", the first three messages could be related because there are exactly three directories with "(invalid encoding)" in the directory that is being accessed:

(thunar:30301): GLib-CRITICAL **: g_str_has_prefix: assertion `str != NULL' failed

(thunar:30301): GLib-CRITICAL **: g_str_has_prefix: assertion `str != NULL' failed

(thunar:30301): GLib-CRITICAL **: g_str_has_prefix: assertion `str != NULL' failed
[New Thread 0x7fffdf034700 (LWP 32075)]
[Thread 0x7fffdf034700 (LWP 32075) exited]

Program received signal SIGSEGV, Segmentation fault.
__strrchr_sse2 () at ../sysdeps/x86_64/multiarch/../strrchr.S:33
33      ../sysdeps/x86_64/multiarch/../strrchr.S: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  __strrchr_sse2 () at ../sysdeps/x86_64/multiarch/../strrchr.S:33
#1  0x000000000044af60 in thunar_path_entry_match_func (completion=<optimized out>, key=<optimized out>, 
    iter=0x7fffffffa790, user_data=<optimized out>) at thunar-path-entry.c:900
#2  0x00007ffff69de66a in gtk_entry_completion_visible_func (model=<optimized out>, iter=0x7fffffffa790, 
    data=<optimized out>) at gtkentrycompletion.c:821
#3  0x00007ffff6b2487e in gtk_tree_model_filter_visible (filter=<optimized out>, child_iter=<optimized out>)
    at gtktreemodelfilter.c:764
#4  0x00007ffff6b26214 in gtk_tree_model_filter_build_level (filter=0xba9160, parent_level=<optimized out>, 
    parent_elt_index=<optimized out>, emit_inserted=0) at gtktreemodelfilter.c:535
#5  0x00007ffff6b2736d in gtk_tree_model_filter_get_iter (model=0xba9160, iter=0x7fffffffa8e0, 
    path=0x7fffd4001100) at gtktreemodelfilter.c:2306
#6  0x00007ffff6b46313 in IA__gtk_tree_view_set_model (tree_view=0xc246f0, model=0xba9160)
    at gtktreeview.c:10856
#7  0x00007ffff69dfb7f in IA__gtk_entry_completion_set_model (completion=0x723050, model=0x7fffd001f640)
    at gtkentrycompletion.c:1052
#8  0x000000000044b756 in thunar_path_entry_changed (editable=<optimized out>) at thunar-path-entry.c:616
#9  0x00007ffff4ea7c02 in g_closure_invoke (closure=0xbda0a0, return_value=0x0, n_param_values=1, 
    param_values=0x7fffffffab90, invocation_hint=<optimized out>) at gclosure.c:777
#10 0x00007ffff4eb9219 in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=<optimized out>, 
    emission_return=0x0, instance_and_params=0x7fffffffab90) at gsignal.c:3589
#11 0x00007ffff4ec0ef2 in g_signal_emit_valist (instance=0xbe32e0, signal_id=<optimized out>, detail=0, 
    var_args=<optimized out>) at gsignal.c:3300
#12 0x00007ffff4ec157b in g_signal_emit_by_name (instance=0xbe32e0, detailed_signal=<optimized out>)
    at gsignal.c:3393
#13 0x00007ffff69d2191 in end_change (entry=0xbe32e0) at gtkentry.c:2422
#14 0x00007ffff69daf6c in IA__gtk_entry_set_text (entry=0xbe32e0, 
    text=0xbb2ca0 "sftp://user@server.com/some/dir/contains\366character") at gtkentry.c:6827
#15 0x000000000044a7cf in thunar_path_entry_set_current_file (path_entry=0xbe32e0, 
    current_file=<optimized out>) at thunar-path-entry.c:1184
#16 0x00007ffff4eaffe2 in object_set_property (nqueue=0xb49460, value=0x7fffffffb030, pspec=0xbe1b70, 
    object=0xbe32e0) at gobject.c:1352
#17 g_object_set_property (object=0xbe32e0, property_name=<optimized out>, value=0x7fffffffb030)
    at gobject.c:2149
#18 0x00007ffff799c55c in exo_bind_properties_transfer (src_object=0x814530, src_pspec=<optimized out>, 
    dst_object=0xbe32e0, dst_pspec=0xbe1b70, transform=0x7ffff4ecccb0 <g_value_transform>, user_data=0x0)
    at exo-binding.c:148
#19 0x00007ffff799c75f in exo_bind_properties_notify (src_object=0x814530, src_pspec=0x766e80, data=0xafac50)
    at exo-binding.c:167
#20 0x00007ffff4ea7c02 in g_closure_invoke (closure=0x770460, return_value=0x0, n_param_values=2, 
    param_values=0x7fffffffb280, invocation_hint=<optimized out>) at gclosure.c:777
#21 0x00007ffff4eb8c51 in signal_emit_unlocked_R (node=<optimized out>, detail=525, instance=<optimized out>, 
    emission_return=0x0, instance_and_params=0x7fffffffb280) at gsignal.c:3551
#22 0x00007ffff4ec0ef2 in g_signal_emit_valist (instance=0x814530, signal_id=<optimized out>, detail=525, 
    var_args=<optimized out>) at gsignal.c:3300
#23 0x00007ffff4ec1092 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, 
    detail=<optimized out>) at gsignal.c:3356
#24 0x00007ffff4eac867 in g_object_dispatch_properties_changed (object=0x814530, n_pspecs=1, 
    pspecs=0x7fffffffb5c0) at gobject.c:1041
#25 0x00007ffff4eac2fe in g_object_notify_queue_thaw (object=0x814530, nqueue=<optimized out>) at gobject.c:291
#26 0x00007ffff4eafed4 in g_object_set_property (object=0x814530, property_name=<optimized out>, 
    value=<optimized out>) at gobject.c:2151
#27 0x00007ffff799c55c in exo_bind_properties_transfer (src_object=0x6da400, src_pspec=<optimized out>, 
    dst_object=0x814530, dst_pspec=0x766e80, transform=0x7ffff4ecccb0 <g_value_transform>, user_data=0x0)
    at exo-binding.c:148
#28 0x00007ffff799c75f in exo_bind_properties_notify (src_object=0x6da400, src_pspec=0x724400, data=0xc6fd90)
    at exo-binding.c:167
#29 0x00007ffff4ea7c02 in g_closure_invoke (closure=0x770500, return_value=0x0, n_param_values=2, 
    param_values=0x7fffffffb970, invocation_hint=<optimized out>) at gclosure.c:777
#30 0x00007ffff4eb8c51 in signal_emit_unlocked_R (node=<optimized out>, detail=525, instance=<optimized out>, 
    emission_return=0x0, instance_and_params=0x7fffffffb970) at gsignal.c:3551
#31 0x00007ffff4ec0ef2 in g_signal_emit_valist (instance=0x6da400, signal_id=<optimized out>, detail=525, 
    var_args=<optimized out>) at gsignal.c:3300
#32 0x00007ffff4ec1092 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, 
    detail=<optimized out>) at gsignal.c:3356
#33 0x00007ffff4eac867 in g_object_dispatch_properties_changed (object=0x6da400, n_pspecs=1, 
    pspecs=0x7fffffffbcb8) at gobject.c:1041
#34 0x00007ffff4eae143 in g_object_notify_by_spec_internal (pspec=0x724400, object=0x6da400) at gobject.c:1133
#35 g_object_notify (object=0x6da400, property_name=<optimized out>) at gobject.c:1175
#36 0x000000000047ca8a in thunar_window_set_current_directory (window=0x6da400, 
    current_directory=0x7fffd40158f0) at thunar-window.c:3043
#37 0x00007ffff4ea7c02 in g_closure_invoke (closure=0xb3dfa0, return_value=0x0, n_param_values=2, 
    param_values=0x7fffffffbf00, invocation_hint=<optimized out>) at gclosure.c:777
#38 0x00007ffff4eb8c51 in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=<optimized out>, 
    emission_return=0x0, instance_and_params=0x7fffffffbf00) at gsignal.c:3551
#39 0x00007ffff4ec0ef2 in g_signal_emit_valist (instance=0xb1e530, signal_id=<optimized out>, detail=0, 
    var_args=<optimized out>) at gsignal.c:3300
#40 0x00007ffff4ec1092 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, 
    detail=<optimized out>) at gsignal.c:3356
#41 0x0000000000442377 in thunar_launcher_open_file (launcher=0xb1e530, file=0x7fffd40158f0)
    at thunar-launcher.c:1017
#42 thunar_launcher_poke_file_finish (target_file=0x7fffd40158f0, browser=0xb1e530, file=<optimized out>, 
    error=<optimized out>, ignored=<optimized out>) at thunar-launcher.c:1051
#43 thunar_launcher_poke_file_finish (browser=0xb1e530, file=<optimized out>, target_file=0x7fffd40158f0, 
    error=<optimized out>, ignored=<optimized out>) at thunar-launcher.c:1043
#44 0x0000000000425da8 in thunar_browser_poke_file (browser=0xb1e530, file=0x7fffd40158f0, widget=0x6da400, 
    func=0x4422a0 <thunar_launcher_poke_file_finish>, user_data=0x0) at thunar-browser.c:545
#45 0x00007ffff4ea7c02 in g_closure_invoke (closure=0x732560, return_value=0x0, n_param_values=1, 
    param_values=0x7fffffffc470, invocation_hint=<optimized out>) at gclosure.c:777
#46 0x00007ffff4eb8c51 in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=<optimized out>, 
    emission_return=0x0, instance_and_params=0x7fffffffc470) at gsignal.c:3551
#47 0x00007ffff4ec0ef2 in g_signal_emit_valist (instance=0xb280c0, signal_id=<optimized out>, detail=0, 
    var_args=<optimized out>) at gsignal.c:3300
#48 0x00007ffff4ec1092 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, 
    detail=<optimized out>) at gsignal.c:3356
#49 0x00007ffff6985c78 in _gtk_action_emit_activate (action=0xb280c0) at gtkaction.c:795
#50 0x00007ffff4eaaf77 in g_cclosure_marshal_VOID__BOXEDv (closure=0xb499e0, return_value=<optimized out>, 
    instance=0xc6a260, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, 
    param_types=0xc66ae0) at gmarshal.c:1160
#51 0x00007ffff4ea7e2d in _g_closure_invoke_va (closure=0xb499e0, return_value=0x0, instance=0xc6a260, 
    args=0x7fffffffca98, n_params=1, param_types=<optimized out>) at gclosure.c:840
#52 0x00007ffff4ec0581 in g_signal_emit_valist (instance=0xc6a260, signal_id=<optimized out>, detail=0, 
    var_args=<optimized out>) at gsignal.c:3211
#53 0x00007ffff4ec1092 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, 
    detail=<optimized out>) at gsignal.c:3356
#54 0x00007ffff79ae1f1 in exo_icon_view_button_press_event (widget=<optimized out>, event=0x7fffd40050b0)
    at exo-icon-view.c:2266
#55 0x00007ffff6a47518 in _gtk_marshal_BOOLEAN__BOXED (closure=0x715600, return_value=0x7fffffffcd80, 
    n_param_values=<optimized out>, param_values=0x7fffffffcdf0, invocation_hint=<optimized out>, 
    marshal_data=<optimized out>) at gtkmarshalers.c:86
#56 0x00007ffff4ea7c02 in g_closure_invoke (closure=0x715600, return_value=0x7fffffffcd80, n_param_values=2, 
    param_values=0x7fffffffcdf0, invocation_hint=<optimized out>) at gclosure.c:777
#57 0x00007ffff4eb9219 in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=<optimized out>, 
    emission_return=0x7fffffffcfc0, instance_and_params=0x7fffffffcdf0) at gsignal.c:3589
#58 0x00007ffff4ec0bde in g_signal_emit_valist (instance=0xc6a260, signal_id=<optimized out>, detail=0, 
    var_args=<optimized out>) at gsignal.c:3310
#59 0x00007ffff4ec1092 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, 
    detail=<optimized out>) at gsignal.c:3356
#60 0x00007ffff6b60211 in gtk_widget_event_internal (widget=0xc6a260, event=0x7fffd40050b0) at gtkwidget.c:5010
#61 0x00007ffff6a456a3 in IA__gtk_propagate_event (widget=0xc6a260, event=0x7fffd40050b0) at gtkmain.c:2490
#62 0x00007ffff6a45a03 in IA__gtk_main_do_event (event=0x7fffd40050b0) at gtkmain.c:1685
#63 0x00007ffff64ad58c in gdk_event_dispatch (source=<optimized out>, callback=<optimized out>, 
    user_data=<optimized out>) at gdkevents-x11.c:2403
#64 0x00007ffff4bc0b73 in g_main_dispatch (context=0x6e7220) at gmain.c:2539
#65 g_main_context_dispatch (context=0x6e7220) at gmain.c:3075
#66 0x00007ffff4bc0ec0 in g_main_context_iterate (dispatch=1, block=<optimized out>, context=0x6e7220, 
    self=<optimized out>) at gmain.c:3146
#67 g_main_context_iterate (context=0x6e7220, block=<optimized out>, dispatch=1, self=<optimized out>)
    at gmain.c:3083
#68 0x00007ffff4bc12ba in g_main_loop_run (loop=0x6fb740) at gmain.c:3340
#69 0x00007ffff6a44a57 in IA__gtk_main () at gtkmain.c:1257
#70 0x000000000041da97 in main (argc=1, argv=0x7fffffffd458) at main.c:308

Note that in non-daemon mode, I can access the directories, and the location bar will either cut off the text at the bad character or display another unreadable character like \Uffffffff (sorry, it doesn't copy as a single character but maybe even better so) and without the "(invalid character)" suffix.

This is 100% reproducible here.
Comment 1 Harald Judt 2012-10-15 14:17:14 CEST
Just one amendment: While in non-daemon mode thunar doesn't crash, the following line is printed (apparently) for such "invalid encoding" items:

Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
Comment 2 Nick Schermer editbugs 2012-10-20 19:41:47 CEST
Fixed in 3c9a18f.
Comment 3 Harald Judt 2012-10-22 19:59:59 CEST
Thanks, fix confirmed. Thunar doesn't crash anymore when accessing GVFS directories and files with invalid character encoding.

Bug #9376

Reported by:
Harald Judt
Reported on: 2012-10-15
Last modified on: 2012-10-22

People

Assignee:
Jannis Pohlmann
CC List:
1 user

Version

Attachments

Additional information