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

xfiles should exit on unexpected error #33

Open
apprehensions opened this issue Mar 6, 2023 · 4 comments
Open

xfiles should exit on unexpected error #33

apprehensions opened this issue Mar 6, 2023 · 4 comments

Comments

@apprehensions
Copy link
Contributor

i've recently found myself having to manually kill XFiles in the terminal due to unexpected errors it faces, one of which are failing to thumbnail.

if the thumbnailer itself fails, and returns a non 0 return code, XFiles will just hang.

i've also faced this weird error:

xfiles: /home/sewn: No such file or directory

and XFiles just hangs, despite rendering my home directory correctly.

@phillbush
Copy link
Owner

Hi,

XFiles should not hang when a thumbnailer fails (returns nonzero); but since it waits for the thumbnailer to exit, XFiles can hang if it does not return.

Can you try to run XFiles on the directory where thumbnailing hangs and check whether it is a thumbnail script not exiting?

On the $HOME error, I could not reproduce it, can you provide more information on how you faced it?

@apprehensions
Copy link
Contributor Author

XFiles should not hang when a thumbnailer fails (returns nonzero); but since it waits for the thumbnailer to exit, XFiles can hang if it does not return.

so what do i do when thumbnail fails? it fails most of the time and i have to manually delete xfiles cache to regenerate thumbanils.

newfstatat(AT_FDCWD, ".steampath", {st_mode=S_IFLNK|0777, st_size=29, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(AT_FDCWD, ".steampath", 0x7ffe5d959820, 0) = -1 ENOENT (No such file or directory)
write(2, "xfiles: ", 8)                 = 8
write(2, "/home/sewn", 10)              = 10
write(2, ": No such file or directory\n", 28) = 28

i believe above is an error from a dangling symlink from scanning a directory, and such the function responsible for getting files is only provided with an argument, the argument is the error.

you can reproduce this by making an invalid symlink.

@alpheratz0
Copy link
Contributor

i believe above is an error from a dangling symlink from scanning a directory, and such the function responsible for getting files is only provided with an argument, the argument is the error.

yeah thats the issue, also shouldn't it be printing the name of the file which fails to stat?

xfiles/xfiles.c

Line 520 in e6a181c

warn("%s", cwd->path);

should be something like this

if (!(islink && errno == ENOENT))
	warn("%s", array[i]->d_name);

@phillbush
Copy link
Owner

phillbush commented Mar 28, 2023

xfiles/xfiles.c

Line 520 in e6a181c

warn("%s", cwd->path);

should be something like this

if (!(islink && errno == ENOENT))
	warn("%s", array[i]->d_name);

Indeed, it was warning an issue related to the directory, but the issue is related to a file in it.
It is fixed now.

i believe above is an error from a dangling symlink from scanning a directory, and such the function responsible for getting files is only provided with an argument, the argument is the error.

XFiles passes the full path of a file to the thumbnailer, even if it is a broken link, it is upon the thumbnailer command to either exit in failure or save a icon indicating the broken symbol as thumbnail. I still think it is the thumbnailer command which is hanging; if it hang again, can you check XFile's process tree and check whether that is the case?

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

3 participants