URL: <http://savannah.gnu.org/bugs/?48030>
Summary: -exec + does not pass all arguments for ceratin specific filename lengths Project: findutils Submitted by: None Submitted on: Thu 26 May 2016 04:07:06 PM UTC Category: find Severity: 3 - Normal Item Group: Wrong result Status: None Privacy: Public Assigned to: None Originator Name: Joe Philip Ninan Originator Email: india...@gmail.com Open/Closed: Open Discussion Lock: Any Release: 4.4.2 Fixed Release: None _______________________________________________________ Details: # 1. the version of findutils you are using We could reproduce this bug over many machines. All of them had find (GNU findutils) 4.4.2 # 2. what you were trying to do We were trying to execute a command using find's -exec comand + # 3. the exact command line that you used find RashuBug -type f -exec md5sum {} + | wc -l # 4. what you expected to happen This directory RashuBug has 3719 files in it. So we expected 3719 lines of output # 5. precisely what did happen. The last file was not passed to md5sum command, and we got only 3718 lines as output. # 6. How to reproduce this bug I am attaching RashuBug.tar.gz file. Extract this tar.gz file to obtain a directory RashuBug/ containing 3719 empty files. give the following command, $ find RashuBug -type f -exec md5sum {} + | wc -l You will get output 3718 (Because last file missing!) $ cp -r RashuBug RashuBugs $ find RashuBugs -type f -exec md5sum {} + | wc -l You will get all 3719 output this time. # 7. Interesting Observations which might provide some clues. As metione above, this bug disappears if the length of the directory name is not exactly 8. For example if you rename this Directory as RashuBugs, it will give all 3719 output. This bug also disappears if the command, in this case md5sum is not exactly 6 characters. For example, the following command works perfectly $ find RashuBug -type f -exec echo {} + | tr ' ' '\n' | wc -l But if you create a new command 6 characters long $ ln -s /usr/bin/echo /usr/bin/echooo $ find RashuBug -type f -exec echooo {} + | tr ' ' '\n' | wc -l Then the bug re-appears, and it is missing the last file. Hence the issue is not with md5sum command. For this very specific length of filenames, directory name and command name, find command is dropping the last file it finds while passing as arguments to the -exec command. If you delete any one file from the the RashuBug directory, also this bug disappears. But if you add a new file by $ touch RashuBug/new.fits Then the bug appears when the command it is excuting is 4 characters long. So this bug is appearing for this specif length of filenames. We discovered this bug, by accident, while dealing with large collection of telescope observatory data. The contents of the files are not important to reproduce this bug. Hence the attached RashuBug.tar.gz contains empty files with exact filenames of our data created using touch command! _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Thu 26 May 2016 04:07:06 PM UTC Name: RashuBug.tar.gz Size: 44kB By: None Filenames which can reproduce this bug <http://savannah.gnu.org/bugs/download.php?file_id=37280> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?48030> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/