Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g_file_info_ unset attributes cause errors in the logs #1704

Open
UnoSD opened this issue Mar 19, 2023 · 12 comments
Open

g_file_info_ unset attributes cause errors in the logs #1704

UnoSD opened this issue Mar 19, 2023 · 12 comments

Comments

@UnoSD
Copy link

UnoSD commented Mar 19, 2023

Expected behaviour

Set GFileInfo attributes and avoid errors in the logs

Actual behaviour

(caja:11315): GLib-GIO-CRITICAL **: 10:23:35.501: GFileInfo created without standard::sort-order

(caja:11315): GLib-GIO-CRITICAL **: 10:23:35.502: file ../glib/gio/gfileinfo.c: line 2061 (g_file_info_get_sort_order): should not be reached

(caja:11315): GLib-GIO-CRITICAL **: 10:23:35.502: GFileInfo created without standard::symlink-target

(caja:11315): GLib-GIO-CRITICAL **: 10:23:35.502: file ../glib/gio/gfileinfo.c: line 2015 (g_file_info_get_symlink_target): should not be reached

(caja:11315): GLib-GIO-CRITICAL **: 10:23:35.752: GFileInfo created without standard::sort-order

(caja:11315): GLib-GIO-CRITICAL **: 10:23:35.752: file ../glib/gio/gfileinfo.c: line 2061 (g_file_info_get_sort_order): should not be reached

(caja:11315): GLib-GIO-CRITICAL **: 10:23:35.752: GFileInfo created without standard::symlink-target

(caja:11315): GLib-GIO-CRITICAL **: 10:23:35.752: file ../glib/gio/gfileinfo.c: line 2015 (g_file_info_get_symlink_target): should not be reached

Steps to reproduce the behaviour

Use caja

MATE general version

N/A, using Xfce

Package version

MATE caja 1.26.1

Linux Distribution

Arch

@universexplorer
Copy link

Same problem on my system, Mate desktop environment. However, the file gfileinfo.c could not be found at all, but there is a similar file with this full path: /usr/include/glib-2.0/gio/gfileinfo.h

@L-U-T-i
Copy link

L-U-T-i commented May 8, 2023

gfileinfo.c is a part of the source package and not contained in a distribution package. If you'd like to check it, take a look in glib2 source of your distro.

Does this: https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1143 help anyhow?

@L-U-T-i
Copy link

L-U-T-i commented May 8, 2023

I've created a patch which should resolve the issue:

diff -up a/libcaja-private/caja-directory-async.c b/libcaja-private/caja-directory-async.c
--- a/libcaja-private/caja-directory-async.c	2023-05-08 18:28:32.971206230 +0200
+++ b/libcaja-private/caja-directory-async.c	2023-05-08 18:28:33.040206707 +0200
@@ -3807,7 +3807,7 @@ static gboolean is_trusted_system_deskto
         return FALSE;
     }
 
-    target = g_file_info_get_symlink_target (info);
+    target = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET);
     if (!target) {
         goto done;
     }
diff -up a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
--- a/libcaja-private/caja-file.c	2023-05-08 18:28:30.500189123 +0200
+++ b/libcaja-private/caja-file.c	2023-05-08 18:28:30.639190084 +0200
@@ -2396,7 +2396,7 @@ update_info_internal (CajaFile *file,
 	}
 	file->details->size_on_disk = size_on_disk;
 
-	sort_order = g_file_info_get_sort_order (info);
+	sort_order = g_file_info_get_attribute_int32 (info, G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER);
 	if (file->details->sort_order != sort_order) {
 		changed = TRUE;
 	}
@@ -2451,7 +2451,7 @@ update_info_internal (CajaFile *file,
 		file->details->thumbnailing_failed = (thumbnailing_failed != FALSE);
 	}
 
-	symlink_name = g_file_info_get_symlink_target (info);
+	symlink_name = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET);
 	if (eel_strcmp (file->details->symlink_name, symlink_name) != 0) {
 		changed = TRUE;
 		g_free (file->details->symlink_name);

Build with this patch went fine, I can however not test it as I am not getting this log...

@fredo-m
Copy link

fredo-m commented Oct 13, 2023

Hi,

Same problem on a machine. I have the impression that I don't have this problem on all machines even though they all have the same version of caja (Debian 1.26.1-1).

oct. 13 14:50:35 caja[2405]: GFileInfo created without standard::sort-order
oct. 13 14:50:35 caja[2405]: file ../../../gio/gfileinfo.c: line 2108 (g_file_info_get_sort_order): should not be reached
oct. 13 14:50:35 caja[2405]: GFileInfo created without standard::symlink-target
oct. 13 14:50:35 caja[2405]: file ../../../gio/gfileinfo.c: line 2062 (g_file_info_get_symlink_target): should not be reached
oct. 13 14:50:35 caja[2405]: GFileInfo created without standard::sort-order
oct. 13 14:50:35 caja[2405]: file ../../../gio/gfileinfo.c: line 2108 (g_file_info_get_sort_order): should not be reached
oct. 13 14:50:35 caja[2405]: GFileInfo created without standard::symlink-target
oct. 13 14:50:35 caja[2405]: file ../../../gio/gfileinfo.c: line 2062 (g_file_info_get_symlink_target): should not be reached
oct. 13 14:50:35 caja[2405]: GFileInfo created without standard::sort-order
oct. 13 14:50:35 caja[2405]: file ../../../gio/gfileinfo.c: line 2108 (g_file_info_get_sort_order): should not be reached
oct. 13 14:50:35 caja[2405]: GFileInfo created without standard::symlink-target
oct. 13 14:50:35 caja[2405]: file ../../../gio/gfileinfo.c: line 2062 (g_file_info_get_symlink_target): should not be reached
oct. 13 14:50:35 caja[2405]: GFileInfo created without standard::sort-order
oct. 13 14:50:35 caja[2405]: file ../../../gio/gfileinfo.c: line 2108 (g_file_info_get_sort_order): should not be reached
oct. 13 14:50:35 caja[2405]: GFileInfo created without standard::symlink-target
oct. 13 14:50:35 caja[2405]: file ../../../gio/gfileinfo.c: line 2062 (g_file_info_get_symlink_target): should not be reached
oct. 13 14:50:41 caja[2405]: GFileInfo created without standard::sort-order

@lukefromdc
Copy link
Member

lukefromdc commented Oct 13, 2023

This was already fixed in master with
1096ea0
which is in 1.27.2 sounds like we need to cherrypick this to 1.26

@L-U-T-i your patch is correct and appears to be identical to what I used in the above commit.

@luigifab
Copy link

luigifab commented Oct 21, 2023

Yes please update 1.26.x :) because my .xsession-errors is now more than 100 Mb!
(Debian Testing caja 1.26.1-1)

@xpander69
Copy link

Ohh cheers! I was wondering why the logs get super huge.
Just built the 1.27.2 caja and it seems to have solved the issue.
Not sure if its good idea to mix 1.26 stuff with 1.27 but caja seems to work fine :)

@luigifab
Copy link

luigifab commented Feb 2, 2024

Still no fix? I'm sad.
This is dangerous for space disk for some normal users.

@lukefromdc
Copy link
Member

Fix would be to cherrypick (or if that fails, backport) 1096ea0 to 1.26

@lukefromdc
Copy link
Member

cherrypick to fix this went clean:
4888855
A new 1.26 point release will be needed for distros to pick this up. Rolling release distros will be moving to 1.28 when that comes out, I don't know how many non-rolling releases are going to be using the combination of glib 1.76 or later with MATE 1.26 in perpetuity, but I would assume at least some are.

@lukefromdc
Copy link
Member

We got the docker error on travis for rebuilding 1.26 so that will need to be fixed as in master to do a new release.

A local test build worked fine

@uralets
Copy link

uralets commented Feb 3, 2024

welp... Guess it WILL make it into Ubuntu 24.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants