OS: Ubuntu Linux 20.04 LTS - 64bit
Searching for similar files in a folder that contains symlinks to other folders results in program attempting to look in the symlinked folders some times results in infinite path recursion. Screenshot: Effect: This results in infinite path recursion (symlink loop) when there are symlinks in the traversed path pointing to a folder that is within the same traversed path. This is undesired behavior. This usually happens when there're symlinks linking to any folder on parent dir that has symlinks to current folder and any other similar cases. Same happens when trying to use "Show files in subfolder" function, resulting in enormous memory usage and subsequent system hang after some time.
To reproduce:
1. Execute commands as shown below to create a test directory structure
Code: Select all
mkdir -p test/{Dir1,Dir2,Dir3} && cd test
Code: Select all
find /path/to/some/dir -maxdepth 1 -type f | shuf -n 10 | xargs -I{} cp "{}" Dir1
Code: Select all
cp Dir1/*.* Dir2
cp Dir1/*.* Dir3
Code: Select all
cd Dir1
ln -s ../Dir2 Dir2
ln -s ../Dir3 Dir3
cd ../Dir2
ln -s ../Dir1 Dir1
ln -s ../Dir3 Dir3
cd ../Dir3
ln -s ../Dir1 Dir1
ln -s ../Dir2 Dir2
Actual behaviour (bug): Symlinks are traversed upon similar files search and when trying to load images from subfolder, causing infinite path recursion when traversed path contains symlinks to any folder found within the search path tree some times causing enormous momory usage and subsequent system hang
Expected behaviour: No symlinks traversed anywhere in the code, infinite path recursion caused by traversed path containing symlinks to other folders found within the search path tree should not happen.