! 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 !
trying to unmount an NFS mount rooted under ~ makes thunar go into an infinit...
Status:
RESOLVED: FIXED

Comments

Description Landry Breuil editbugs 2012-12-13 21:56:54 CET
OpenBSD doesn't have Gudev, so NFS mounts are the only things shown under devices (with the root disk). If i mount an nfs share under a subdir of ~ it's shown in thunar.

right-clicking on it and selecting unmount (or clicking the eject button) makes thunar show a notification, then a gtk dialog, and then thunar goes into an infinite loop.

Bt of 4 threads :

(gdb) bt
#0  0x038f0459 in poll () at <stdin>:2
#1  0x000e7412 in poll (fds=0x89fa3840, nfds=7, timeout=-1) at /usr/src/lib/librthread/rthread_cancel.c:331
#2  0x0d94202b in g_poll () from /usr/local/lib/libglib-2.0.so.3400.0
#3  0x0d9343a7 in g_main_context_acquire () from /usr/local/lib/libglib-2.0.so.3400.0
#4  0x0d93560c in g_main_loop_run () from /usr/local/lib/libglib-2.0.so.3400.0
#5  0x08fd593c in g_dbus_proxy_get_cached_property_names () from /usr/local/lib/libgio-2.0.so.3400.0
#6  0x0d959782 in g_thread_proxy () from /usr/local/lib/libglib-2.0.so.3400.0
#7  0x000e410e in _rthread_start (v=0x85c2d400) at /usr/src/lib/librthread/rthread.c:122
#8  0x038d7229 in __tfork_thread () at /usr/src/lib/libc/arch/i386/sys/tfork_thread.S:92
(gdb) thread 2

(gdb) bt
#0  0x03921689 in read () at <stdin>:2
#1  0x000e71f2 in read (fd=4, buf=0xcfbf6e28, nbytes=16) at /usr/src/lib/librthread/rthread_cancel.c:397
#2  0x0d97609b in g_wakeup_acknowledge () from /usr/local/lib/libglib-2.0.so.3400.0
#3  0x0d932ef2 in g_main_context_check () from /usr/local/lib/libglib-2.0.so.3400.0
#4  0x0d93431d in g_main_context_acquire () from /usr/local/lib/libglib-2.0.so.3400.0
#5  0x0d93560c in g_main_loop_run () from /usr/local/lib/libglib-2.0.so.3400.0
#6  0x01245c23 in gtk_dialog_run () from /usr/local/lib/libgtk-x11-2.0.so.2400.0
#7  0x1c02bcdb in __register_frame_info ()
#8  0x1c063fcd in __register_frame_info ()
#9  0x1c02d19d in __register_frame_info ()
#10 0x08f6c27f in g_simple_async_result_complete () from /usr/local/lib/libgio-2.0.so.3400.0
#11 0x08f92e47 in g_unix_fd_message_new () from /usr/local/lib/libgio-2.0.so.3400.0
#12 0x0d930f32 in g_source_is_destroyed () from /usr/local/lib/libglib-2.0.so.3400.0
#13 0x0d932664 in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.3400.0
#14 0x0d934379 in g_main_context_acquire () from /usr/local/lib/libglib-2.0.so.3400.0
#15 0x0d93560c in g_main_loop_run () from /usr/local/lib/libglib-2.0.so.3400.0
#16 0x012cb014 in gtk_main () from /usr/local/lib/libgtk-x11-2.0.so.2400.0
#17 0x1c01bfcb in __register_frame_info ()
#18 0x1c018bb7 in ?? ()
#19 0x1c018bb7 in ?? ()

(gdb) thread 3
[Switching to thread 3 (thread 1000169)]#0  0x038cbe95 in kevent () at <stdin>:2
2       <stdin>: No such file or directory.
        in <stdin>
(gdb) bt
#0  0x038cbe95 in kevent () at <stdin>:2
#1  0x08ff3d59 in g_local_file_monitor_get_type () from /usr/local/lib/libgio-2.0.so.3400.0
#2  0x000e410e in _rthread_start (v=0x7e368600) at /usr/src/lib/librthread/rthread.c:122
#3  0x038d7229 in __tfork_thread () at /usr/src/lib/libc/arch/i386/sys/tfork_thread.S:92

(gdb) thread 4

(gdb) bt
#0  0x038f0459 in poll () at <stdin>:2
#1  0x000e7412 in poll (fds=0x8366dd40, nfds=1, timeout=-1) at /usr/src/lib/librthread/rthread_cancel.c:331
#2  0x0d94202b in g_poll () from /usr/local/lib/libglib-2.0.so.3400.0
#3  0x0d9343a7 in g_main_context_acquire () from /usr/local/lib/libglib-2.0.so.3400.0
#4  0x0d934460 in g_main_context_iteration () from /usr/local/lib/libglib-2.0.so.3400.0
#5  0x0d9344c6 in g_main_context_iteration () from /usr/local/lib/libglib-2.0.so.3400.0
#6  0x0d959782 in g_thread_proxy () from /usr/local/lib/libglib-2.0.so.3400.0
#7  0x000e410e in _rthread_start (v=0x85fd9e00) at /usr/src/lib/librthread/rthread.c:122
#8  0x038d7229 in __tfork_thread () at /usr/src/lib/libc/arch/i386/sys/tfork_thread.S:92

Fully reproducible.
Comment 1 Landry Breuil editbugs 2012-12-13 22:42:59 CET
The notify popup comes from thunar_notify_unmount, line 169. Interestingly thunar_notify_device_readonly() seems to return true, while the nfs mount is definitely RW.

So the operation that blocks/fails is in thunar_device_unmount(). It's normal to me that the operation fails since the user isnt able to unmount this nfs mount (root only), but thunar doesnt seem to handle the failure okay.
Comment 2 Landry Breuil editbugs 2012-12-13 23:05:04 CET
Oh, looks like i was mistaken; thunar_device_unmount() is not called, because the nfs mount seems to be seen as an "ejectable" device. If i set a breakpoint in thunar_notify_unmount() it's called from thunar_device_eject().

Breakpoint 2, thunar_notify_unmount (device=0x7e201700) at thunar-notify.c:159
159       _thunar_return_if_fail (THUNAR_IS_DEVICE (device));
Current language:  auto; currently c
(gdb) bt
#0  thunar_notify_unmount (device=0x7e201700) at thunar-notify.c:159
#1  0x1c03b1ff in thunar_device_eject (device=0x7e201700, mount_operation=0x82a761c0, cancellable=0x0, callback=0x1c091c79 <thunar_shortcuts_view_eject_finish>, 
    user_data=0x83a3e000) at thunar-device.c:820
#2  0x1c092064 in thunar_shortcuts_view_eject (view=0x83a3e000) at thunar-shortcuts-view.c:1885
#3  0x1c08e575 in thunar_shortcuts_view_button_release_event (widget=0x83a3e000, event=0x839d29f8) at thunar-shortcuts-view.c:495

device->kind is THUNAR_DEVICE_KIND_MOUNT_LOCAL though. In the right-click menu i have "disconnect", so the nfs mount is in the THUNAR_SHORTCUT_GROUP_DEVICES_MOUNTS case in thunar_shortcuts_view_context_menu()

Maybe it should be in THUNAR_SHORTCUT_GROUP_DEVICES_VOLUMES or that's only for gudev devices ?
Comment 3 Landry Breuil editbugs 2012-12-13 23:15:15 CET
sidenote : thunar_device_can_eject returns true for the ThunarDevice (which is not a volume, but a mount apparently), because g_mount_can_unmount returns true.

443       else if (G_IS_MOUNT (device->device))
(gdb) 
447           can_eject = g_mount_can_eject (device->device) || g_mount_can_unmount (device->device);
(gdb) p device->device
$4 = 0x7f655690
(gdb) p g_mount_can_eject(device->device)
$5 = 0
(gdb) p g_mount_can_unmount(device->device)
$6 = 1
Comment 4 Landry Breuil editbugs 2012-12-13 23:32:12 CET
Interestingly, if i single-step in gdb inside thunar_device_eject(), all the code runs fine until the exit of the func. An empty gtk dialog is shown, if i close the dialog thunar comes back fine.

The dialog seems to come from thunar_device_operation_finish()

The GError returned by g_mount_unmount_with_operation_finish() properly contains the reason of the failure (EPERM) :

$17 = {domain = 863, code = 0, message = 0x7fbd2440 "umount: /home/landry/mikey: Operation not permitted\n"}

the ThunarDeviceCallback (ie thunar_shortcuts_view_eject_finish()) is then called, and that one stalls when creating the dialog :

1842          device_name = thunar_device_get_name (device);
(gdb) 
1843          thunar_dialogs_show_error (GTK_WIDGET (view), error, _("Failed to eject \"%s\""), device_name);
(gdb) p device_name
$18 = (gchar *) 0x86996980 "mikey"
(gdb) n

here, i have an empty dialog, and thunar window is frozen. If i close the empty dialog through the wm button, thunar comes back.


So two interrogations remain :
- why is thunar_dialogs_show_error() showing an empty dialog ?
- why is the nfs mount considered 'ejectable' instead of 'unmountable' ?
Comment 5 Nick Schermer editbugs 2012-12-30 00:22:03 CET
Eject in thunar mean 'permanently' remove the device; or at least try to. Inside the thunar_device_eject function, eventually g_mount_unmount_with_operation is chosen, so that's fine. I'll check why the error is not working, possibly because its return in a different thread.
Comment 6 Harald Judt editbugs 2015-04-17 16:21:19 CEST
Closing, reopen if this is still an issue.

Bug #9633

Reported by:
Landry Breuil
Reported on: 2012-12-13
Last modified on: 2015-04-17

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Attachments

Additional information