After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708824 - gnome_desktop_thumbnail_factory_generate_thumbnail doesn't work on remote files
gnome_desktop_thumbnail_factory_generate_thumbnail doesn't work on remote files
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: Thumbnail
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-26 10:49 UTC by Alexander Larsson
Modified: 2013-09-30 07:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gs_file_get_path_cached: Unlock mutex on error (859 bytes, patch)
2013-09-27 07:48 UTC, Alexander Larsson
committed Details | Review
thumbnail loader: Support loading thumbnails from remote locations (1.22 KB, patch)
2013-09-27 07:49 UTC, Alexander Larsson
committed Details | Review

Description Alexander Larsson 2013-09-26 10:49:27 UTC
I had a crash in gnome_desktop_thumbnail_factory_generate_thumbnail crash when loading recent:/// in nautilus.

It crashed in gnome-desktop-thumbnail.c:_gdk_pixbuf_new_from_uri_at_scale() at:

  if (input_stream == NULL)
     input_stream = gs_file_read_noatime (file, NULL, &error);
     if (input_stream == NULL) {
        g_warning ("Unable to create an input stream for %s: %s", uri, 
                    error->message);

Because input_stream was NULL, but error was NULL too. Due to 
gs_file_read_noatime() doing:

 path = g_file_get_path (file);
 if (path == NULL)
   return NULL;

I.e. without setting the GError.

But, apart from this obvious bug, it seems that using this function will not work on *any* non-local file.
Comment 1 Alexander Larsson 2013-09-26 10:55:22 UTC
Oh, it seems the crash was fixed via bug 699252.
But the other problem still stands, gs_file_read_noatime() only works for local files.
Comment 2 Alexander Larsson 2013-09-26 10:57:16 UTC
Actually, i guess it *may* work on backends with fuse files, but it will do the loads via fuse, which is not ideal.

gs_file_read_noatime() should *only* be called if g_file_is_native().
Comment 3 Alexander Larsson 2013-09-27 07:48:48 UTC
Created attachment 255898 [details] [review]
gs_file_get_path_cached: Unlock mutex on error
Comment 4 Alexander Larsson 2013-09-27 07:49:59 UTC
Created attachment 255899 [details] [review]
thumbnail loader: Support loading thumbnails from remote locations

This broke with the previous addition of gs_file_read_noatime().
Comment 5 Bastien Nocera 2013-09-27 08:07:07 UTC
Review of attachment 255899 [details] [review]:

Looks good.
Comment 6 Alexander Larsson 2013-09-27 08:13:54 UTC
Comment on attachment 255899 [details] [review]
thumbnail loader: Support loading thumbnails from remote locations

Attachment 255899 [details] pushed as 0df46b7 - thumbnail loader: Support loading thumbnails from remote locations
Comment 7 Colin Walters 2013-09-27 11:59:29 UTC
Review of attachment 255898 [details] [review]:

Looks right, thanks!
Comment 8 Colin Walters 2013-09-27 11:59:31 UTC
Review of attachment 255898 [details] [review]:

Looks right, thanks!
Comment 9 Alexander Larsson 2013-09-30 07:28:32 UTC
Comment on attachment 255898 [details] [review]
gs_file_get_path_cached: Unlock mutex on error

Attachment 255898 [details] pushed as 3c63e8c - gs_file_get_path_cached: Unlock mutex on error
Comment 10 Alexander Larsson 2013-09-30 07:29:32 UTC
I commited this to libgsystem, but with the other fix I don't think gnome-desktop will hit that case, so this is essentially fixed even if we don't update libgsystem.