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

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

Open
jglick opened this issue Sep 7, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@jglick
Copy link

jglick commented Sep 7, 2019

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
Copy link
Author

jglick commented Sep 7, 2019

rdfind/Dirlist.cc

Lines 161 to 169 in f943aed

if (S_ISDIR(info.st_mode)) {
std::cerr << "Dirlist.cc::handlepossiblefile: This should never happen. "
"FIXME! details on the next row:\n";
std::cerr << "possiblefile=\"" << possiblefile << "\"\n";
// this should never happen, because this function is only to be called
// for items that can not be opened with opendir.
// maybe it happens if someone else is changing the file while we
// are reading it?
return -2;

@pauldreik
Copy link
Owner

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

@pauldreik pauldreik added the bug Something isn't working label Sep 10, 2019
@YetAnotherSimon
Copy link

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
Copy link

   // 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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants