GNOME Bugzilla – Bug 356717
race/leak with ssh connections
Last modified: 2018-08-17 13:44:46 UTC
I tracked down why auth dialogs do not work in the file chooser for ssh bookmarks. What is happening is that the filechooser calls get_file_info() for the ssh uri, which causes the ssh backend to lock the connection table and go into sftp_connect(), while keeping the table locked. It spawns a first ssh to determine details about the ssh server. Meanwhile, the thread running the file chooser code has proceeded, and decided to reload the bookmarks for some reason, which causes all outstanding file system operations to be canceled and restarted. The sftp_connect code goes on to determine that it needs auth, so it async auth callbacks (in invoke_fill_auth). This calls gnome_vfs_module_callback_invoke and eventually async_callback_invoke, which dispatches the module callback with _gnome_vfs_dispatch_module_callback and waits for the callback to be done. However, since this thread's job is already cancelled (see above), the callback is never called, and the thread never wakes up, keeping the sftp connection table locked.
Ideas for improvement: 1) don't hold the connection table lock while creating a new connection 2) don't loose the information if the callback was actually set up in job_notify, but pass it on so that async_callback_invoke can avoid waiting if the callback was not set up
gnome-vfs got deprecated in 2008. gnome-vfs is not under active development anymore and had its last code changes in 2011. Its codebase has been archived: https://gitlab.gnome.org/Archive/gnome-vfs/commits/master gio (in glib) and gvfs are its successors. See https://developer.gnome.org/gio/stable/ch33.html and https://people.gnome.org/~gicmo/gio-migration-guide/ for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent + supported version of glib/gio/gvfs. Thanks!