pauldreik / rdfind

find duplicate files utility
Other
951 stars 77 forks source link

Assertion failure from Dirlist.cc::handlepossiblefile on unreadable subdirectory #32

Open jglick opened 5 years ago

jglick commented 5 years ago

Running 1.4.1 from the Ubuntu package. Works fine except when encountering unreadable subdirectories:

tmp$ mkdir rdfind-test
tmp$ sudo mkdir rdfind-test/subdir
tmp$ sudo touch rdfind-test/subdir/file
tmp$ mkdir rdfind-test/otherdir
tmp$ touch rdfind-test/otherdir/file
tmp$ rdfind rdfind-test/
Now scanning "rdfind-test", found 0 files.
Now have 0 files in total.
Removed 0 files due to nonunique device and inode.
Total size is 0 bytes or 0 B
Removed 0 files due to unique sizes from list.0 files left.
Now eliminating candidates based on first bytes:removed 0 files from list.0 files left.
Now eliminating candidates based on last bytes:removed 0 files from list.0 files left.
Now eliminating candidates based on sha1 checksum:removed 0 files from list.0 files left.
It seems like you have 0 files that are not unique
Totally, 0 B can be reduced.
Now making results file results.txt
tmp$ sudo chmod go-rwx rdfind-test/subdir/
tmp$ rdfind rdfind-test/
Now scanning "rdfind-test"Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="rdfind-test/subdir"
, found 0 files.
Now have 0 files in total.
Removed 0 files due to nonunique device and inode.
Total size is 0 bytes or 0 B
Removed 0 files due to unique sizes from list.0 files left.
Now eliminating candidates based on first bytes:removed 0 files from list.0 files left.
Now eliminating candidates based on last bytes:removed 0 files from list.0 files left.
Now eliminating candidates based on sha1 checksum:removed 0 files from list.0 files left.
It seems like you have 0 files that are not unique
Totally, 0 B can be reduced.
Now making results file results.txt
jglick commented 5 years ago

https://github.com/pauldreik/rdfind/blob/f943aed57526965853b0871e372805b02d8bbf01/Dirlist.cc#L161-L169

pauldreik commented 5 years ago

Thank you for reporting this! As a cosmic coincidence, here is what xkcd contains today: https://xkcd.com/2200/

YetAnotherSimon commented 6 months ago

Hi, this just happened to me.

Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-ci/builds"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-workhorse"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/.ssh"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-rails/tmp"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-rails/upgrade-status"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-rails/shared"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-rails/sockets"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-rails/etc"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-rails/uploads"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-rails/working"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-kas"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/git-data"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/backups"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitaly"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/postgres-exporter"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/logrotate"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/prometheus"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/alertmanager"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/postgresql/data"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/gitlab-shell"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/data/nginx"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/gitlab-workhorse"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/gitlab-rails"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/gitlab-kas"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/redis-exporter"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/puma"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/redis"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/gitaly"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/postgres-exporter"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/logrotate"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/prometheus"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/alertmanager"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/gitlab-exporter"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/postgresql"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/gitlab-shell"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/sidekiq"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/Gitlab/logs/nginx"
Dirlist.cc::handlepossiblefile: This should never happen. FIXME! details on the next row:
possiblefile="./[...]/var/lib/libvirt/qemu"

I checked two of these folders, and they had 700 permissions with another user as owner, so this might be an issue with opening a folder without permission.

fire-eggs commented 6 months ago
   // this should never happen, because this function is only to be called 
   // for items that can not be opened with opendir. 

From the opendir documentation, possible errno values include 'EACCES : Permission denied'.