Infinite recursion with symlinked file ending in ".desktop"
Thunar started segfaulting for me at startup after the latest update to 4.19.1. I bisected the issue back to 00c0bc15 and determined that it was recursing infinitely on a symlink named .profile.desktop
.
Here's a gdb trace of the last two loops:
#8 0x000055b63d4ef57f in thunar_file_load.constprop.0 (file=file@entry=0x7facbb799d00, error=error@entry=0x0, cancellable=0x0) at /usr/src/debug/xfce-base/thunar-4.19.1/thunar-4.19.1/thunar/thunar-file.c:1189
#9 0x000055b63d49a45b in thunar_file_get (gfile=gfile@entry=0x7facbb799b00, error=error@entry=0x0) at /usr/src/debug/xfce-base/thunar-4.19.1/thunar-4.19.1/thunar/thunar-file.c:1267
#10 0x000055b63d49c76c in thunar_file_can_execute (file=file@entry=0x7facbb7995b0, ask_execute=ask_execute@entry=0x0) at /usr/src/debug/xfce-base/thunar-4.19.1/thunar-4.19.1/thunar/thunar-file.c:3009
#11 0x000055b63d49ca1a in thunar_file_info_reload (file=0x7facbb7995b0, cancellable=0x0) at /usr/src/debug/xfce-base/thunar-4.19.1/thunar-4.19.1/thunar/thunar-file.c:991
#12 0x000055b63d4ef5ea in thunar_file_load.constprop.0 (file=file@entry=0x7facbb7995b0, error=error@entry=0x0, cancellable=0x0) at /usr/src/debug/xfce-base/thunar-4.19.1/thunar-4.19.1/thunar/thunar-file.c:1211
#13 0x000055b63d49a45b in thunar_file_get (gfile=gfile@entry=0x7facbb799460, error=error@entry=0x0) at /usr/src/debug/xfce-base/thunar-4.19.1/thunar-4.19.1/thunar/thunar-file.c:1267
#14 0x000055b63d49c76c in thunar_file_can_execute (file=file@entry=0x7facbb798eb0, ask_execute=ask_execute@entry=0x0) at /usr/src/debug/xfce-base/thunar-4.19.1/thunar-4.19.1/thunar/thunar-file.c:3009
#15 0x000055b63d49ca1a in thunar_file_info_reload (file=0x7facbb798eb0, cancellable=0x0) at /usr/src/debug/xfce-base/thunar-4.19.1/thunar-4.19.1/thunar/thunar-file.c:991
I'm not entirely sure I understand the changes introduced in 00c0bc15 - as far as I can see thunar_g_file_resolve_symlink
is not actually resolving symbolic links anymore, but rather just reporting a symlink's relative path. Because of this, Thunar recurses infinitely when checking for executability of a .desktop file.
As far as I understand the loop goes:
- thunar_file_info_reload: checking whether a file is a desktop file and whether it's executable
-
thunar_file_can_execute:
thunar_file_can_execute
determines that the file is a symlink, and then hasthunar_g_file_resolve_symlink
report the relative path to the same file -
thunar_file_get
triggers on the same file, callingthunar_file_load
and thenthunar_file_info_reload
.
Edited by Wolfgang Müller