Bug 493143 - find -execdir {} + does not do what it claims
Summary: find -execdir {} + does not do what it claims
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: findutils
Version: 12
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 589621
TreeView+ depends on / blocked
 
Reported: 2009-03-31 19:03 UTC by Gen Zhang
Modified: 2010-06-24 16:20 UTC (History)
2 users (show)

Fixed In Version: findutils-4.4.2-8.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 589621 (view as bug list)
Environment:
Last Closed: 2010-06-10 19:18:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
backport of upstream commit 41896c730790d6afa9feabc867aaa14198873a76 (5.44 KB, patch)
2010-05-06 13:15 UTC, Kamil Dudka
no flags Details | Diff
backport of upstream commit 7dc70069a3095a42eadb22b24cb9260c243aff8f (28.06 KB, patch)
2010-05-06 13:15 UTC, Kamil Dudka
no flags Details | Diff
backport of upstream commit 27a7e451b84808408bf23b3f8a0363acb36e1a96 (3.49 KB, patch)
2010-05-06 13:16 UTC, Kamil Dudka
no flags Details | Diff
backport of upstream commit e1d0a991e96ee164d74579efc027b09336e50c79 (8.51 KB, patch)
2010-05-06 13:16 UTC, Kamil Dudka
no flags Details | Diff
backport of upstream commit a1f54022d1913a92ccb728211127d5c238397eb6 (3.74 KB, patch)
2010-05-06 13:17 UTC, Kamil Dudka
no flags Details | Diff

Description Gen Zhang 2009-03-31 19:03:06 UTC
Description of problem:

The -execdir option no longer does what it claims in the man page. If invoked as:

find . -execdir echo {} +

it should recursive into each directory and print a list of the files in that list.


Version-Release number of selected component (if applicable): 4.4.0


How reproducible: Everytime


Steps to Reproduce:
1. Make two directories containing, respectively, file11, file12, file13 and file21, file22
2. run: find . -execdir echo {} +
  
Actual results:
./file11
./file12
./file13
./file21
./file22


Expected results:
./file11 ./file12 ./file13
./file21 ./file22

Additional info:

This is actually known as an upstream report http://savannah.gnu.org/bugs/?19593 but they seem to think that it's a performance issue. It is not. This fundamentally changes the semantics of the option. Calls that relied on being passed all the files in each subdir at the same time no longer works.

Comment 1 Kamil Dudka 2009-09-08 11:31:13 UTC
Thanks for the report! I can confirm your results with the current git HEAD. The findutils package was changed to use FTS for directory tree traversing in 4.4.0 and this functionality hasn't been implemented yet. It's known issue, which you can find well described directly in the sources:

  /* XXX: if we allow a build-up of pending arguments for "-execdir foo {} +"
   * we need to execute them in the same directory as we found the item.
   * If we are trying to do "find a -execdir echo {} +", we will need to
   * echo
   *      a while in the original working directory
   *      b while in a
   *      c while in b (just before leaving b)
   *
   * These restrictions are hard to satisfy while using fts().   The reason is
   * that it doesn't tell us just before we leave a directory.  For the moment,
   * we punt and don't allow the arguments to build up.
   */

Comment 2 Bug Zapper 2009-11-18 09:57:53 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Kamil Dudka 2009-11-18 22:26:56 UTC
I've just changed the version to rawhide. There is no known solution and nobody
is working on the fix right now. It will definitely not get into Fedora 10.

Comment 4 Bug Zapper 2010-03-15 12:29:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Kamil Dudka 2010-04-11 17:26:17 UTC
also related:

http://savannah.gnu.org/bugs/?27563

(patches available for current git HEAD as well as the 4.4.x branch)

Comment 8 Kamil Dudka 2010-05-05 11:45:21 UTC
This should be fixed in findutils-4.5.9-1.fc14.  Please let me know if that's the case.  I'll probably prepare some backports.

Comment 9 Kamil Dudka 2010-05-06 13:15:23 UTC
Created attachment 412016 [details]
backport of upstream commit 41896c730790d6afa9feabc867aaa14198873a76

Comment 10 Kamil Dudka 2010-05-06 13:15:49 UTC
Created attachment 412017 [details]
backport of upstream commit 7dc70069a3095a42eadb22b24cb9260c243aff8f

Comment 11 Kamil Dudka 2010-05-06 13:16:08 UTC
Created attachment 412018 [details]
backport of upstream commit 27a7e451b84808408bf23b3f8a0363acb36e1a96

Comment 12 Kamil Dudka 2010-05-06 13:16:57 UTC
Created attachment 412022 [details]
backport of upstream commit e1d0a991e96ee164d74579efc027b09336e50c79

Comment 13 Kamil Dudka 2010-05-06 13:17:20 UTC
Created attachment 412023 [details]
backport of upstream commit a1f54022d1913a92ccb728211127d5c238397eb6

Comment 14 Kamil Dudka 2010-05-06 14:22:36 UTC
Trivial upstream commits 26d1e75d52d9741188ff6b1e9e77c65fff0df8ff and 7e87abf61fcb03ba0b01159e2704f62fd7bb0e46 are also included, as well as part of the following (not yet in upstream) one:

http://lists.gnu.org/archive/html/bug-findutils/2010-05/msg00004.html

Comment 15 Kamil Dudka 2010-05-10 16:14:20 UTC
backported patches proposed upstream:

http://lists.gnu.org/archive/html/bug-findutils/2010-05/msg00028.html

Comment 16 Fedora Update System 2010-05-10 16:20:14 UTC
findutils-4.4.2-7.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/findutils-4.4.2-7.fc13

Comment 17 Fedora Update System 2010-05-10 16:20:23 UTC
findutils-4.4.2-7.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/findutils-4.4.2-7.fc12

Comment 18 Fedora Update System 2010-05-10 21:51:05 UTC
findutils-4.4.2-7.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update findutils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/findutils-4.4.2-7.fc13

Comment 19 Fedora Update System 2010-05-11 19:40:59 UTC
findutils-4.4.2-7.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update findutils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/findutils-4.4.2-7.fc12

Comment 20 Matt McCutchen 2010-05-13 06:07:53 UTC
(In reply to comment #0)
> This is actually known as an upstream report
> http://savannah.gnu.org/bugs/?19593 but they seem to think that it's a
> performance issue. It is not. This fundamentally changes the semantics of the
> option. Calls that relied on being passed all the files in each subdir at the
> same time no longer works.    

No, upstream is right.  It was never guaranteed that "-execdir ... +" would pass all the files in a single subdirectory at the same time, so one would be wrong to rely on that behavior.

Comment 21 Kamil Dudka 2010-05-13 08:04:10 UTC
(In reply to comment #20)
> No, upstream is right.  It was never guaranteed that "-execdir ... +" would
> pass all the files in a single subdirectory at the same time, so one would be
> wrong to rely on that behavior.    

That's what James told me on the upstream mailing list already.  Nevertheless did you find it stated anywhere in the documentation?

Comment 22 Fedora Update System 2010-05-22 01:51:25 UTC
findutils-4.4.2-7.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Kamil Dudka 2010-05-23 16:49:15 UTC
It seems to cause a regression, reopening:

http://savannah.gnu.org/bugs/?29949
http://bugs.debian.org/582717

Comment 24 Kamil Dudka 2010-05-24 16:11:12 UTC
I proposed upstream a solution for the problem above:
https://savannah.gnu.org/bugs/download.php?file_id=20607

A build for rawhide including the patch is available:
http://koji.fedoraproject.org/koji/buildinfo?buildID=174820

Before patching the stable findutils, I'll give some time upstream to response.

Comment 25 Fedora Update System 2010-06-01 10:55:39 UTC
findutils-4.4.2-8.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/findutils-4.4.2-8.fc13

Comment 26 Fedora Update System 2010-06-01 10:55:45 UTC
findutils-4.4.2-8.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/findutils-4.4.2-8.fc12

Comment 27 Fedora Update System 2010-06-01 18:11:58 UTC
findutils-4.4.2-8.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update findutils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/findutils-4.4.2-8.fc13

Comment 28 Fedora Update System 2010-06-01 18:25:58 UTC
findutils-4.4.2-8.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update findutils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/findutils-4.4.2-8.fc12

Comment 29 Fedora Update System 2010-06-10 19:18:23 UTC
findutils-4.4.2-8.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 30 Fedora Update System 2010-06-24 16:20:47 UTC
findutils-4.4.2-8.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.