! 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 !
Crash on mount/unmount on FreeBSD 11.2, 12.0, starting from 1.6.16
Status:
RESOLVED: MOVED

Comments

Description Ivan 83 2019-03-10 05:08:46 CET
(thunar:26889): thunar-CRITICAL **: 06:48:08.298: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:48:08.299: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:48:08.299: unable to set property 'device' of type 'ThunarDevice' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:48:08.299: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:48:08.299: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:48:08.299: unable to set property 'file' of type 'ThunarFile' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:48:08.299: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:48:08.299: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:48:08.299: unable to set property 'text' of type 'gchararray' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:48:08.299: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:48:08.299: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:48:08.299: unable to set property 'attributes' of type 'PangoAttrList' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:48:08.299: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:48:08.299: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:48:08.299: unable to set property 'device' of type 'ThunarDevice' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:48:08.299: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:48:08.299: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:48:08.299: unable to set property 'file' of type 'ThunarFile' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:48:08.299: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:48:08.299: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:48:08.299: unable to set property 'text' of type 'gchararray' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:48:08.299: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:48:08.299: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:48:08.299: unable to set property 'attributes' of type 'PangoAttrList' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:48:08.299: thunar_tree_model_iter_next: assertion 'iter->stamp == ((((ThunarTreeModel*) g_type_check_instance_cast ((GTypeInstance*) ((tree_model)), ((thunar_tree_model_get_type ()))))))->stamp' failed

(thunar:26889): Gtk-CRITICAL **: 06:48:08.299: gtktreeview.c:6293 (do_validate_rows): assertion `gtk_tree_model_iter_next (tree_view->priv->model, &iter)' failed.
There is a disparity between the internal view of the GtkTreeView,
and the GtkTreeModel.  This generally means that the model has changed
without letting the view know.  Any display from now on is likely to
be incorrect.


(thunar:26889): thunar-CRITICAL **: 06:50:47.292: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:50:47.292: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:50:47.292: unable to set property 'device' of type 'ThunarDevice' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:50:47.292: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:50:47.292: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:50:47.292: unable to set property 'file' of type 'ThunarFile' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:50:47.292: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:50:47.292: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:50:47.292: unable to set property 'text' of type 'gchararray' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:50:47.292: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:26889): GLib-GObject-CRITICAL **: 06:50:47.292: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:26889): GLib-GObject-WARNING **: 06:50:47.292: unable to set property 'attributes' of type 'PangoAttrList' from value of type '(null)'

(thunar:26889): thunar-CRITICAL **: 06:50:47.292: thunar_tree_model_iter_next: assertion 'iter->stamp == ((((ThunarTreeModel*) g_type_check_instance_cast ((GTypeInstance*) ((tree_model)), ((thunar_tree_model_get_type ()))))))->stamp' failed

(thunar:26889): Gtk-CRITICAL **: 06:50:47.292: gtktreeview.c:6293 (do_validate_rows): assertion `gtk_tree_model_iter_next (tree_view->priv->model, &iter)' failed.
There is a disparity between the internal view of the GtkTreeView,
and the GtkTreeModel.  This generally means that the model has changed
without letting the view know.  Any display from now on is likely to
be incorrect.


If build with --enable-debug=yes - no crash, only this messages.
Comment 1 alexxcons editbugs 2019-03-10 21:57:58 CET
Hmm, cannot reproduce the crash / the crit. messages on my debian.
Can you paste the exact mount command you used ?

"thunar_tree_model_get_value" --> Does the crash happens only if tree-view is active ?

I guess this bug is caused by one of the following commits:
https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=81fc76226596a82b50c08fa2a2ab50f619ffa1a3
https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=87731222ada23b24cfbb2c422d3ef2907c8fead3
https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=2963db9bfa7a9305a3f49037e1ed0caa1082e418
https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=95925eb023144ebe199234b65bafc1f08696f5de

Could you please take a try for git bisect, in order to see which commit causes the problem ?
Comment 2 Ivan 83 2019-03-11 02:17:26 CET
Looks like there is few different bugs.

All 4 commits reverted, on thunar close:
====================================================================================
(thunar:81543): GLib-GObject-WARNING **: 03:30:01.535: invalid uninstantiatable type '(null)' in cast to 'GObject'

(thunar:81543): GLib-GObject-CRITICAL **: 03:30:01.535: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
====================================================================================


With: https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=95925eb023144ebe199234b65bafc1f08696f5de
1. thunar /media/da4
2. mount_msdosfs -o noatime -o longnames -m 644 -M 755 -D CP866 -L ru_RU.UTF-8 /dev/da4 /media/da4
3. refresh
====================================================================================
(thunar:22247): thunar-CRITICAL **: 03:38:33.429: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:22247): GLib-GObject-CRITICAL **: 03:38:33.429: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:22247): GLib-GObject-WARNING **: 03:38:33.429: unable to set property 'device' of type 'ThunarDevice' from value of type '(null)'

(thunar:22247): thunar-CRITICAL **: 03:38:33.429: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:22247): GLib-GObject-CRITICAL **: 03:38:33.429: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:22247): GLib-GObject-WARNING **: 03:38:33.429: unable to set property 'file' of type 'ThunarFile' from value of type '(null)'

(thunar:22247): thunar-CRITICAL **: 03:38:33.429: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:22247): GLib-GObject-CRITICAL **: 03:38:33.429: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:22247): GLib-GObject-WARNING **: 03:38:33.429: unable to set property 'text' of type 'gchararray' from value of type '(null)'

(thunar:22247): thunar-CRITICAL **: 03:38:33.429: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:22247): GLib-GObject-CRITICAL **: 03:38:33.429: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:22247): GLib-GObject-WARNING **: 03:38:33.429: unable to set property 'attributes' of type 'PangoAttrList' from value of type '(null)'

(thunar:22247): thunar-CRITICAL **: 03:39:15.287: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:22247): GLib-GObject-CRITICAL **: 03:39:15.287: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:22247): GLib-GObject-WARNING **: 03:39:15.287: unable to set property 'device' of type 'ThunarDevice' from value of type '(null)'

(thunar:22247): thunar-CRITICAL **: 03:39:15.287: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:22247): GLib-GObject-CRITICAL **: 03:39:15.287: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:22247): GLib-GObject-WARNING **: 03:39:15.287: unable to set property 'file' of type 'ThunarFile' from value of type '(null)'

(thunar:22247): thunar-CRITICAL **: 03:39:15.287: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:22247): GLib-GObject-CRITICAL **: 03:39:15.287: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:22247): GLib-GObject-WARNING **: 03:39:15.287: unable to set property 'text' of type 'gchararray' from value of type '(null)'

(thunar:22247): thunar-CRITICAL **: 03:39:15.287: thunar_tree_model_get_value: assertion 'iter->user_data != ((void *)0)' failed

(thunar:22247): GLib-GObject-CRITICAL **: 03:39:15.287: g_value_transform: assertion 'G_IS_VALUE (src_value)' failed

(thunar:22247): GLib-GObject-WARNING **: 03:39:15.287: unable to set property 'attributes' of type 'PangoAttrList' from value of type '(null)'

(thunar:22247): Gtk-CRITICAL **: 03:39:15.290: gtktreeview.c:5016 (gtk_tree_view_bin_expose): assertion `has_next' failed.
There is a disparity between the internal view of the GtkTreeView,
and the GtkTreeModel.  This generally means that the model has changed
without letting the view know.  Any display from now on is likely to
be incorrect.


(thunar:22247): Gtk-CRITICAL **: 03:39:33.355: gtk_tree_view_unref_tree_helper: assertion 'node != NULL' failed

(thunar:22247): GLib-GObject-WARNING **: 03:39:33.372: invalid uninstantiatable type '(null)' in cast to 'GObject'

(thunar:22247): GLib-GObject-CRITICAL **: 03:39:33.372: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
====================================================================================


With: https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=81fc76226596a82b50c08fa2a2ab50f619ffa1a3
OK, no warnings/errors on plug/unplug/refresh



With https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=2963db9bfa7a9305a3f49037e1ed0caa1082e418
on start, if:
1. mount_msdosfs -o noatime -o longnames -m 644 -M 755 -D CP866 -L ru_RU.UTF-8 /dev/da4 /media/da4
2. thunar /media/da4
====================================================================================
(thunar:9670): Gdk-WARNING **: 03:55:47.774: gdk_window_set_icon_list: icons too large

(thunar:9670): thunar-CRITICAL **: 03:55:47.818: thunar_file_get_info: assertion '(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((file)); GType __t = ((thunar_file_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))' failed

(thunar:9670): GLib-GIO-CRITICAL **: 03:55:47.818: g_file_info_get_attribute_boolean: assertion 'G_IS_FILE_INFO (info)' failed
====================================================================================


With https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=2963db9bfa7a9305a3f49037e1ed0caa1082e418
https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=87731222ada23b24cfbb2c422d3ef2907c8fead3

OK.


Looks like problems with: https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=95925eb023144ebe199234b65bafc1f08696f5de
I build with reverted this commit and all works fine.
I will do more test at this week at work, but I think that is it.



PS: compilation time warnings:
====================================================================================
thunar-tree-view.c:765:15: warning: variable 'file' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
          if (path != NULL && gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
thunar-tree-view.c:782:15: note: uninitialized use occurs here
          if (file)
              ^~~~
thunar-tree-view.c:765:11: note: remove the 'if' if its condition is always true
          if (path != NULL && gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
thunar-tree-view.c:765:15: warning: variable 'file' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
          if (path != NULL && gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
              ^~~~~~~~~~~~
thunar-tree-view.c:782:15: note: uninitialized use occurs here
          if (file)
              ^~~~
thunar-tree-view.c:765:15: note: remove the '&&' if its condition is always true
          if (path != NULL && gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
              ^~~~~~~~~~~~~~~
thunar-tree-view.c:705:26: note: initialize the variable 'file' to silence this warning
  ThunarFile        *file;
                         ^
                          = NULL
thunar-tree-view.c:765:15: warning: variable 'device' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
          if (path != NULL && gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
thunar-tree-view.c:770:16: note: uninitialized use occurs here
          if ((device != NULL && thunar_device_is_mounted (device)) ||
               ^~~~~~
thunar-tree-view.c:765:11: note: remove the 'if' if its condition is always true
          if (path != NULL && gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
thunar-tree-view.c:765:15: warning: variable 'device' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
          if (path != NULL && gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
              ^~~~~~~~~~~~
thunar-tree-view.c:770:16: note: uninitialized use occurs here
          if ((device != NULL && thunar_device_is_mounted (device)) ||
               ^~~~~~
thunar-tree-view.c:765:15: note: remove the '&&' if its condition is always true
          if (path != NULL && gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path))
              ^~~~~~~~~~~~~~~
thunar-tree-view.c:704:28: note: initialize the variable 'device' to silence this warning
  ThunarDevice      *device;
                           ^
                            = NULL
====================================================================================
Comment 3 Ivan 83 2019-03-11 02:46:36 CET
This patch https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=87731222ada23b24cfbb2c422d3ef2907c8fead3
is required to fix some issues after this https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=2963db9bfa7a9305a3f49037e1ed0caa1082e418
but thunar eat 100%cpu then I open da4 (/media/da4 - mounted flash drive)
Without https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=87731222ada23b24cfbb2c422d3ef2907c8fead3 - no CPU high usage, but thunar glithes in tree: 2 File Sytem items, second if under da4.
Comment 4 alexxcons editbugs 2019-03-11 09:24:52 CET
Hmm .. possibly related to msdosfs ? Does the same happen when you mount something else ?  Does the bug as well show when you use icon view instead of tree-view ?

Actually https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=95925eb023144ebe199234b65bafc1f08696f5de is commit for which I realy did not think that it could break anything, since it is a streight bugfix :P

Will try to format some flashdrive with msdosfs when I have time and see if I can reproduce.
Comment 5 Ivan 83 2019-03-11 20:10:20 CET
Same with UFS2.
Comment 6 alexxcons editbugs 2019-03-22 22:07:13 CET
Still did not test :/  .. possibly you know how to format a flashdrive with ufs2 or msdosfs in linux ?

Meanwhile I added this tree-view related patch to master and the 4.14 branch ... possibly it makes a difference ?
https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.14&id=99c08e8ba9216d9f7e330d68168b0d8f047ac426
Comment 7 alexxcons editbugs 2019-03-22 22:08:15 CET
> ... to master and the 4.14 branch
and to 4.12 branch (Thunar 1.6.x)
Comment 8 Ivan 83 2019-05-19 18:32:12 CEST
Try with 1.6.17 - still crash.

#0  0x0000000800f2c012 in g_type_check_instance_cast (type_instance=0x804a910a0, iface_type=80) at gtype.c:4058
#1  0x000000000032b6e0 in thunar_window_current_directory_changed (current_directory=0x805680230 [ThunarFile], window=0x804b420c0 [ThunarWindow]) at thunar-window.c:3294
#2  0x000000000032b340 in thunar_window_set_current_directory (window=0x804b420c0 [ThunarWindow], current_directory=0x805680230 [ThunarFile]) at thunar-window.c:3805
#6  0x0000000800f23ba8 in <emit signal ??? on instance 0x8050b61c0 [ThunarTreePane]> (instance=0x8050b61c0, signal_id=146, detail=0) at gsignal.c:3447
    #3  0x0000000800efe3bc in g_closure_invoke (closure=0x8054fc470, return_value=0x0, n_param_values=2, param_values=0x7fffffffb730, invocation_hint=0x7fffffffb6e8) at gclosure.c:804
    #4  0x0000000800f21601 in signal_emit_unlocked_R (node=0x804b14260, detail=0, instance=0x8050b61c0, emission_return=0x0, instance_and_params=0x7fffffffb730) at gsignal.c:3635
    #5  0x0000000800f232ba in g_signal_emit_valist (instance=0x8050b61c0, signal_id=146, detail=0, var_args=0x7fffffffbeb0) at gsignal.c:3391
#7  0x00000000002c5a77 in thunar_navigator_change_directory (navigator=0x8050b61c0, directory=0x805680230 [ThunarFile]) at thunar-navigator.c:221
#11 0x0000000800f23ba8 in <emit signal ??? on instance 0x8055da520 [ThunarTreeView]> (instance=0x8055da520, signal_id=146, detail=0) at gsignal.c:3447
    #8  0x0000000800efe3bc in g_closure_invoke (closure=0x8054fc330, return_value=0x0, n_param_values=2, param_values=0x7fffffffc1e0, invocation_hint=0x7fffffffc198) at gclosure.c:804
    #9  0x0000000800f21601 in signal_emit_unlocked_R (node=0x804b14260, detail=0, instance=0x8055da520, emission_return=0x0, instance_and_params=0x7fffffffc1e0) at gsignal.c:3635
    #10 0x0000000800f232ba in g_signal_emit_valist (instance=0x8055da520, signal_id=146, detail=0, var_args=0x7fffffffc960) at gsignal.c:3391
#12 0x00000000002c5a77 in thunar_navigator_change_directory (navigator=0x8055da520, directory=0x805680230 [ThunarFile]) at thunar-navigator.c:221
#13 0x0000000000322d17 in thunar_tree_view_open_selection (view=0x8055da520 [ThunarTreeView]) at thunar-tree-view.c:2191
#14 0x00000000003216aa in thunar_tree_view_action_open (view=0x8055da520 [ThunarTreeView]) at thunar-tree-view.c:2164
#15 0x000000000031f066 in thunar_tree_view_button_release_event (widget=0x8055da520 [ThunarTreeView], event=0x804ae5980) at thunar-tree-view.c:808
#16 0x00000008006ec420 in  () at /usr/local/lib/libgtk-x11-2.0.so.0
#17 0x0000000800efeea8 in g_type_class_meta_marshal
    (closure=0x804b21d20, return_value=0x7fffffffcdf0, n_param_values=2, param_values=0x7fffffffce20, invocation_hint=0x7fffffffcdd8, marshal_data=0x160) at gclosure.c:997
#21 0x0000000800f23ba8 in <emit signal ??? on instance 0x8055da520 [ThunarTreeView]> (instance=0x8055da520, signal_id=43, detail=0) at gsignal.c:3447
    #18 0x0000000800efe3bc in g_closure_invoke (closure=0x804b21d20, return_value=0x7fffffffcdf0, n_param_values=2, param_values=0x7fffffffce20, invocation_hint=0x7fffffffcdd8)
    at gclosure.c:804
    #19 0x0000000800f217c1 in signal_emit_unlocked_R (node=0x8027f7ca0, detail=0, instance=0x8055da520, emission_return=0x7fffffffd348, instance_and_params=0x7fffffffce20)
--Type <RET> for more, q to quit, c to continue without paging--c
    at gsignal.c:3673
    #20 0x0000000800f23360 in g_signal_emit_valist (instance=0x8055da520, signal_id=43, detail=0, var_args=0x7fffffffd5a0) at gsignal.c:3401
#22 0x0000000800852f1b in  () at /usr/local/lib/libgtk-x11-2.0.so.0
#23 0x00000008006e9192 in gtk_propagate_event () at /usr/local/lib/libgtk-x11-2.0.so.0
#24 0x00000008006e8ecd in gtk_main_do_event () at /usr/local/lib/libgtk-x11-2.0.so.0
#25 0x00000008009a527a in  () at /usr/local/lib/libgdk-x11-2.0.so.0
#26 0x00000008010221ea in g_main_dispatch (context=0x8043aa6c0) at gmain.c:3176
#27 0x0000000801022020 in g_main_context_dispatch (context=0x8043aa6c0) at gmain.c:3829
#28 0x00000008010225a8 in g_main_context_iterate (context=0x8043aa6c0, block=1, dispatch=1, self=0x8027e3890) at gmain.c:3902
#29 0x0000000801022a92 in g_main_loop_run (loop=0x804b018a0) at gmain.c:4098
#30 0x00000008006e84a7 in gtk_main () at /usr/local/lib/libgtk-x11-2.0.so.0
#31 0x0000000000264583 in main (argc=1, argv=0x7fffffffd9c0) at main.c:312

Probably memory damaged some where early.
Comment 9 alexxcons editbugs 2019-05-19 21:51:38 CEST
Created attachment 8545 
preleminary fix

According to the backtrace the crash happens at the following thunar method:

  g_object_get (G_OBJECT (window->preferences), "misc-full-path-in-title", &show_full_path, NULL);

Not sure yet why "window->preferences" could consist of corrupt data .. attached a patch which just adds a guard for it ... not a proper fix, but a t least something.

Could you please take a try for it ?
Comment 10 Ivan 83 2019-05-19 22:46:10 CEST
#0  0x0000000800f2c36b in g_type_check_instance (type_instance=0xaaaaaaaaaaaaaaaa) at gtype.c:4129
#1  0x0000000800f20518 in g_signal_handlers_disconnect_matched (instance=0xaaaaaaaaaaaaaaaa, mask=G_SIGNAL_MATCH_DATA, signal_id=0, detail=0, closure=0x0, func=0x0, data=0x804af4f00)
    at gsignal.c:2931
#2  0x000000000029b6cb in thunar_folder_finished (job=0x805765b30 [ThunarSimpleJob], folder=0x804af4f00) at thunar-folder.c:576
#6  0x0000000800f23ba8 in <emit signal ??? on instance 0x805765b30 [ThunarSimpleJob]> (instance=0x805765b30, signal_id=328, detail=0) at gsignal.c:3447
    #3  0x0000000800efe3bc in g_closure_invoke (closure=0x80563e110, return_value=0x0, n_param_values=1, param_values=0x7fffffffcf00, invocation_hint=0x7fffffffceb8) at gclosure.c:804
    #4  0x0000000800f21601 in signal_emit_unlocked_R (node=0x8054fdc20, detail=0, instance=0x805765b30, emission_return=0x0, instance_and_params=0x7fffffffcf00) at gsignal.c:3635
    #5  0x0000000800f232ba in g_signal_emit_valist (instance=0x805765b30, signal_id=328, detail=0, var_args=0x7fffffffd670) at gsignal.c:3391
#7  0x00000008003d07bd in  () at /usr/local/lib/libexo-1.so.0
#8  0x000000080101db06 in g_idle_dispatch (source=0x805b850c0, callback=0x8003d0730, user_data=0x805765b30) at gmain.c:5534
#9  0x00000008010221ea in g_main_dispatch (context=0x8043aa6c0) at gmain.c:3176
#10 0x0000000801022020 in g_main_context_dispatch (context=0x8043aa6c0) at gmain.c:3829
#11 0x00000008010225a8 in g_main_context_iterate (context=0x8043aa6c0, block=1, dispatch=1, self=0x8027e3890) at gmain.c:3902
#12 0x0000000801022a92 in g_main_loop_run (loop=0x804b018a0) at gmain.c:4098
#13 0x00000008006e84a7 in gtk_main () at /usr/local/lib/libgtk-x11-2.0.so.0
#14 0x0000000000264583 in main (argc=1, argv=0x7fffffffd9c0) at main.c:312

That is reproductible.
thunar_folder_finished() has strange thing: it check job but work with folder->job, and folder->job=0xaaaaaaaaaaaaaaaa some how, at that point thunal fails.
May be folder->job should be checked folder->job == job or used jod but at end folder->job=NULL.

Reproduce:
mount -t ufs -o noatime /dev/da4s2a /media/da4s2a (FreeBSD12 memstick)
in Thunar go to /media/da4s2a/etc/periodic/
umount -f /media/da4s2a/
Thunar leave /media/da4s2a/etc/periodic/ in addr bar, press refresh button.

Probably mine glib file monitor should send some notifications but does not.
Comment 11 alexxcons editbugs 2019-05-19 22:51:23 CEST
Hehe, fixed exactly that some days ago for a different bug: 

https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.12&id=5b601d30771dab61adb95295c382bcdb655e7d45

(released in 1.6.17 and 1.8.6 ) ... please take another try !
Comment 12 Ivan 83 2019-05-19 22:56:38 CEST
Nope.

I change to
  if (G_LIKELY (job != NULL))
    {
      g_signal_handlers_disconnect_matched (job, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, folder);
      g_object_unref (job);
      folder->job = NULL;
    }
and fail late on:
folder->monitor = g_file_monitor_directory (thunar_file_get_file (folder->corresponding_file)
folder->corresponding_file=0xaaaaaaaaaaaaaaaa

looks like folder already free/reused, but job refer to it.
Comment 13 alexxcons editbugs 2019-05-19 23:02:35 CEST
meh ... would have been to simple :)

Ok, I'll  try to reproduce & debug it using some FreeBSD12 stick, when I have time.
Comment 14 Ivan 83 2019-05-19 23:45:16 CEST
thunar_folder_finalize()
...
  /* cancel the pending job (if any) */
  if (G_UNLIKELY (folder->job != NULL))
    {
      g_signal_handlers_disconnect_matched (folder->job, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, folder);
      g_object_unref (folder->job);
      folder->job = NULL;
    }
This thing not work. IMHO.
Comment 15 Ivan 83 2019-05-20 02:49:41 CEST
Even bit worse:
thunar_folder_finished()
...
      /* reload folder information too */
      thunar_file_reload (folder->corresponding_file);

>>>>
thunar_file_reload ()
...
  if (!thunar_file_load (file, NULL, NULL))
    {
      /* destroy the file if we cannot query any file information */
      thunar_file_destroy (file); <<<<<< here 'folder' is destroyed
      return FALSE;
    }
<<<<<<
thunar_folder_finished()
... continue process 'folder'

I think I fix it, but please review it, I m not sure that it 100% correct.
Also my old patch to fix build without HAVE_GIO_UNIX.
Comment 16 Ivan 83 2019-05-20 02:50:38 CEST
Created attachment 8548 
crash fix
Comment 17 Ivan 83 2019-05-20 02:52:23 CEST
Created attachment 8549 
build fix
Comment 18 alexxcons editbugs 2019-05-20 21:40:10 CEST
Created attachment 8554 
possibly different fix

Glad that you fixed it ! The risk of calling "thunar_file_reload" was a good spot, I did not know that.

Though I am a bit unhappy with the fix itself.

The guarding of thunar_file_reload really should be improved.  It is called ~20 times cross different files.  So if we are going to fix it, I would fix it everywhere.

1. As far as I understood,"folder->corresponding_file" can get corrupt, not "folder" itself ?  If so, I would use THUNAR_IS_FILE as direct check to see if it got destroyed, rather than indirectly checking the a cancelled exo job.

2. You added "exo_job_cancel" before "g_signal_handlers_disconnect_matched " in order to check if the job got cancelled later. My hope would be that this will not be required any more, when using THUNAR_IS_FILE as check.
Though if still required, I guess we should add "exo_job_cancel" to all occurances of "g_signal_handlers_disconnect_matched(folder->job,...)".

Attached a patch which uses THUNAR_IS_FILE to check ... does it as well fix your crash ? If so, I would add a check + the comment as well in all other locations where thunar_file_reload is called.
Comment 19 alexxcons editbugs 2019-05-20 21:53:19 CEST
Regarding the build fix, thats the one from Bug #12863, correct ?
As far as I can see, it was applied to master and 4.14 branch, but not to 4.12 branch ... I will do so.  I guess I can close Bug #12863 than ?
Comment 20 Ivan 83 2019-05-20 22:25:02 CEST
(In reply to alexxcons from comment #18)
> Created attachment 8554 
> possibly different fix

https://bugzilla.xfce.org/attachment.cgi?id=8545
https://bugzilla.xfce.org/attachment.cgi?id=8554
are same.
I do not test it, I cant reproduse crash in this function amymore. Probably there was memory corruption in other place.

> Glad that you fixed it ! The risk of calling "thunar_file_reload" was a good
> spot, I did not know that.

 * You must be able to handle the case that @file is
 * destroyed during the reload call.
 *
 * Return value: As this function can be used as a callback function
 * for thunar_file_reload_idle, it will always return FALSE to prevent
 * being called repeatedly.

This is bad dsign IMHO.
Probably better return different values on reload 'ok/sheduled' and for 'destroyed'.
And add wrapper for callback that alwas will return FALSE.

 
> Though I am a bit unhappy with the fix itself.

I m too ))) see above )
 

> The guarding of thunar_file_reload really should be improved.  It is called
> ~20 times cross different files.  So if we are going to fix it, I would fix
> it everywhere.
> 
> 1. As far as I understood,"folder->corresponding_file" can get corrupt, not
> "folder" itself ?  If so, I would use THUNAR_IS_FILE as direct check to see
> if it got destroyed, rather than indirectly checking the a cancelled exo job.

As I andestand it not corrupt, it destroy 'folder' by calling proper destructors.
Better idea is return different values as I described above. IMHO.


> 2. You added "exo_job_cancel" before "g_signal_handlers_disconnect_matched "
> in order to check if the job got cancelled later. My hope would be that this
> will not be required any more, when using THUNAR_IS_FILE as check.
> Though if still required, I guess we should add "exo_job_cancel" to all
> occurances of "g_signal_handlers_disconnect_matched(folder->job,...)".

It was first attemt/proof of concept fix.
But folder destructor should call exo_job_cancel() IMHO.
Im not sure about order:
exo_job_cancel() + g_signal_handlers_disconnect_matched()
or
g_signal_handlers_disconnect_matched() + exo_job_cancel()
I see both cases in code.
Also probably G_OBJECT () MUST be used for G_OBJECT (folder->job) and all other cases that passes into g_signal_handlers_disconnect_matched().

Im not sure that using THUNAR_IS_FILE() with pointer to freed memory is good idea.
 

> Attached a patch which uses THUNAR_IS_FILE to check ... does it as well fix
> your crash ? If so, I would add a check + the comment as well in all other
> locations where thunar_file_reload is called.

Probably you attach different patch :)
Comment 21 Ivan 83 2019-05-20 22:26:26 CEST
(In reply to alexxcons from comment #19)
> Regarding the build fix, thats the one from Bug #12863, correct ?
> As far as I can see, it was applied to master and 4.14 branch, but not to
> 4.12 branch ... I will do so.  I guess I can close Bug #12863 than ?

Thanks for that.
Comment 22 alexxcons editbugs 2019-05-20 23:01:36 CEST
Arg, wrong patch ... but actually does not matter, since I guess you are right:

> This is bad design IMHO.
> Probably better return different values on reload 'ok/sheduled' and for 'destroyed'.
> And add wrapper for callback that alwas will return FALSE.

WIll see if I can implement that tomorrow ,..  today its time for some sleep for me :)
Comment 23 alexxcons editbugs 2020-04-26 00:24:02 CEST
Sorry, I totally lost track on this bug.

Meanwhile some tree-view fixes got applied to master / the 4.14 branch, some possibly fixed this patch E.g: 
https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.14&id=ba3502eaaf398ef5fac12dcc9d23fe47959c4eba
https://git.xfce.org/xfce/thunar/commit/?h=xfce-4.14&id=35055c227e46d68e9f46fb4eb9c2854e5ab1c4b3

Could you please take a try if you still can reproduce on thunar master or thunar 1.8.14  ?
Comment 24 Ivan 83 2020-04-26 02:07:16 CEST
These commits are not relevant, but I use Thunar without patches for this.

https://bugzilla.xfce.org/attachment.cgi?id=8548
thunar_file_reload() must return different values if file reloaded or file deleted, and all code that call this function must handle that return values, and if file deleted - do not perform any actions with file pointer - it is already destroyed.

If this will not be done - in future bug will return as regression, because this is thunar_file_reload() usage design issue.
Comment 25 Git Bot editbugs 2020-05-26 23:41:58 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar/-/issues/236.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #15184

Reported by:
Ivan 83
Reported on: 2019-03-10
Last modified on: 2020-05-26

People

Assignee:
alexxcons
CC List:
4 users

Version

Version:
1.6.16

Attachments

preleminary fix (969 bytes, patch)
2019-05-19 21:51 CEST , alexxcons
no flags
crash fix (2.60 KB, patch)
2019-05-20 02:50 CEST , Ivan 83
rozhuk.im : review?
build fix (1.06 KB, text/x-csrc)
2019-05-20 02:52 CEST , Ivan 83
rozhuk.im : review?
possibly different fix (969 bytes, patch)
2019-05-20 21:40 CEST , alexxcons
no flags

Additional information