! 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 !
Thunar crashes when leaving a remote folder
Status:
RESOLVED: FIXED

Comments

Description Andre Miranda editbugs 2017-09-24 04:38:45 CEST
Created attachment 7333 
Patch

I'm experiencing crashes when browsing Windows shared folders, but I've heard other types of remote folders are also affected.
When a remote folder is accessed, this error is printed:

(thunar:9378): thunar-CRITICAL **: thunar_file_watch: assertion '(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ((file_watch->monitor)); GType __t = ((g_file_monitor_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

Upon leaving that folder, Thunar crashes:
thunar:ERROR:thunar-file.c:3929:thunar_file_unwatch: code should not be reached

I found out that a call to g_file_monitor in thunar-file.c:thunar_file_watch has no error handling, and in the case of remote folders this error happens:
Failed to create file monitor: Operation not supported by backend

So when ThunarFolder is finalized and calls thunar_file_unwatch, its file_watch will be NULL and _thunar_assert_not_reached kills Thunar.

I was able to put together a fix, but I'm not sure it's the approach.
Comment 1 Simon Steinbeiss editbugs 2017-10-26 23:38:39 CEST
Your rationale makes sense to me and the patch indeed fixes the navigation issue (that I have with Thunar from git master from pretty much any type of remote location).

One thing to note about the patch is that it introduces a whitespace error:
.git/rebase-apply/patch:13: trailing whitespace.

And while navigating back works I get a lot of
(thunar:26131): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Not sure that is related to your patch though.
Comment 2 Andre Miranda editbugs 2017-10-29 02:59:17 CET
I get the same error when using the 4.12 branch, so it's unrelated to the gtk3 port (probably I'll also apply this patch for this branch).
Yeah, I just noticed the whitespace warn, I'll fix it before pushing.
Unfortunately I can't reproduce the error you mentioned, I'm browsing both a shared folder from a WinXP VM and a remote disk via stfp, going hither and thither but not a single error message is given :/
Comment 3 Git Bot editbugs 2017-11-04 02:46:48 CET
Andre Miranda referenced this bugreport in commit a7355a59e2eb5af635f109852216f7d6064ffb70

Handle cases when file watch is not supported (Bug #13881)

https://git.xfce.org/xfce/thunar/commit?id=a7355a59e2eb5af635f109852216f7d6064ffb70
Comment 4 Git Bot editbugs 2017-11-04 02:49:30 CET
Andre Miranda referenced this bugreport in commit ab50af40ef2d02f49e7f54a35ab41d4c0d80fbff

Handle cases when file watch is not supported (Bug #13881)

https://git.xfce.org/xfce/thunar/commit?id=ab50af40ef2d02f49e7f54a35ab41d4c0d80fbff
Comment 5 Andre Miranda editbugs 2017-11-04 02:50:17 CET
Pushed to master and xfce-4.12, let me know you have any related problem.

Bug #13881

Reported by:
Andre Miranda
Reported on: 2017-09-24
Last modified on: 2017-11-04

People

Assignee:
Xfce Bug Triage
CC List:
3 users

Version

Version:
1.6.12

Attachments

Patch (2.35 KB, patch)
2017-09-24 04:38 CEST , Andre Miranda
no flags

Additional information