bugfindutils - Bugs: bug #20273, xargs -E and find -ok consume too...

 
 

bug #20273: xargs -E and find -ok consume too much seekable input

Submitted by:  Eric Blake <ericb>
Submitted on:  Tue 26 Jun 2007 10:17:13 PM UTC  
 
Category: xargsSeverity: 3 - Normal
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: Eric Blake <ericb>
Originator Name: Eric BlakeOpen/Closed: Closed
Release: 4.1.20Fixed Release: 4.3.9

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 08 Sep 2007 12:50:15 PM UTC, comment #6:

Yes, this is fixed on both 4.2.31+ and 4.3.8+, and is just waiting for a release.

Eric Blake <ericb>
Project AdministratorIn charge of this item.
Sat 08 Sep 2007 12:47:55 PM UTC, comment #5:

Eric fixed this in the 4.3.x tree; I guess this bug could be marked fixed.

James Youngman <jay>
Project Administrator
Fri 17 Aug 2007 09:26:17 PM UTC, comment #4:

On the other hand, rather than making find use the closein module, I decided it was easier to fix yesno within gnulib proper (that way, the same bug in mv, rm, cp, etc. is fixed at the same time). Once I write a testcase and check in the patch here:
http://www.nabble.com/yesno-module-consumes-too-much-input-tf4287835.html

then findutils will only need a patch to ./import-gnulib.config to pick up the gnulib patch, and touchup of the NEWS wording.

Eric Blake <ericb>
Project AdministratorIn charge of this item.
Fri 17 Aug 2007 06:26:46 PM UTC, comment #3:

find -ok suffers from the same fate; so it looks like I will need to patch find to use closein, just like I have already patched xargs.

Eric Blake <ericb>
Project AdministratorIn charge of this item.
Thu 28 Jun 2007 01:11:34 PM UTC, comment #2:

I've applied http://lists.gnu.org/archive/html/findutils-patches/2007-06/msg00035.html for CVS head, and am now working on backporting it to the branch (which involves updating the branch's use of gnulib from 2007-02-24 to at least 2007-06-09).

Eric Blake <ericb>
Project AdministratorIn charge of this item.
Wed 27 Jun 2007 12:57:21 PM UTC, comment #1:

I verified that the bug is still present all the way through 4.3.8, so I'm marking this bug confirmed.

Eric Blake <ericb>
Project AdministratorIn charge of this item.
Tue 26 Jun 2007 10:17:13 PM UTC, original submission:

POSIX requires the following behavior when stdin is seekable:

$ cat blah
1
2
3
$ (xargs -E2 echo; cat) < blah
1
3
$

On systems where exit() does not follow the POSIX rule of restoring seekable input streams back to the next unread character, xargs fails to reset the seekable stream, leading to this result (tested on a Linux machine with glibc 2.3 and xargs 4.1.20):

$ (xargs -E2 echo; cat) < blah
1
$

Although I haven't yet had time to test that the latest findutils still has the bug on this particular Linux machine, I suspect the bug will remain until the point that xargs switches to using the gnulib closein module (it currently only uses the closeout module, which leaves stdin alone).

Machines like Solaris or recent cygwin (1.5.24 or later) do not have this bug, because exit() implies fflush(stdin) which obeys POSIX in this regard.

Eric Blake <ericb>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Posted a comment)
  • -unavailable- added by ericb (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 11 Nov 2007 07:44:47 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.3.9
    Sat 08 Sep 2007 12:50:15 PM UTCericbStatusIn Progress=>Fixed
    Fri 17 Aug 2007 09:26:17 PM UTCericbSummaryxargs -E consumes too much seekable input=>xargs -E and find -ok consume too much seekable input
    Fri 17 Aug 2007 06:26:45 PM UTCericbStatusFixed=>In Progress
    Thu 28 Jun 2007 01:11:34 PM UTCericbStatusConfirmed=>Fixed
    Wed 27 Jun 2007 12:57:21 PM UTCericbStatusNeeds Copyright Assignment=>Confirmed
      Assigned toNone=>ericb
      Summaryxargs -E consumes too much input=>xargs -E consumes too much seekable input

    Back to the top


    Powered by Savane 3.1-cleanup1