[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #48030] -exec + does not pass all arguments for ceratin specific fi

From: anonymous
Subject: [bug #48030] -exec + does not pass all arguments for ceratin specific filename lengths
Date: Thu, 26 May 2016 16:07:09 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0


                 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: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.2
           Fixed Release: None



# 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

# 5. precisely what did happen. 

The last file was not passed to md5sum command, and we got only 3718 lines as

# 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

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

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
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:
Filenames which can reproduce this bug


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]