List Info

Thread: xargs -E consumes too much input




xargs -E consumes too much input
user name
2007-06-26 17:17:14
URL:
  <http://savann
ah.gnu.org/bugs/?20273>

                 Summary: xargs -E consumes too much input
                 Project: findutils
            Submitted by: ericb
            Submitted on: Tuesday 06/26/2007 at 16:17
                Category: xargs
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: Needs Assignment
                 Privacy: Public
             Assigned to: None
         Originator Name: Eric Blake
        Originator Email: ebb9byu.net
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.1.20
           Fixed Release: None

    _______________________________________________________

Details:

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.





    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20273>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




_______________________________________________
Bug-findutils mailing list
Bug-findutilsgnu.org
h
ttp://lists.gnu.org/mailman/listinfo/bug-findutils

xargs -E consumes too much seekable input
user name
2007-06-27 07:57:21
Update of bug #20273 (project findutils):

                  Status:        Needs Assignment =>
Confirmed              
             Assigned to:                    None =>
ericb                  
                 Summary: xargs -E consumes too much input
=> xargs -E
consumes too much seekable input

    _______________________________________________________

Follow-up Comment #1:

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

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20273>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




_______________________________________________
Bug-findutils mailing list
Bug-findutilsgnu.org
h
ttp://lists.gnu.org/mailman/listinfo/bug-findutils

xargs -E consumes too much seekable input
user name
2007-06-28 08:11:35
Update of bug #20273 (project findutils):

                  Status:               Confirmed =>
Fixed                  

    _______________________________________________________

Follow-up Comment #2:

I've applied
http://lists.gnu.org/archive/html/findu
tils-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).

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20273>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




_______________________________________________
Bug-findutils mailing list
Bug-findutilsgnu.org
h
ttp://lists.gnu.org/mailman/listinfo/bug-findutils

xargs -E consumes too much seekable input
user name
2007-08-17 13:26:46
Update of bug #20273 (project findutils):

                  Status:                   Fixed => In
Progress            

    _______________________________________________________

Follow-up 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.


    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20273>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





xargs -E and find -ok consume too much seekable input
user name
2007-08-17 16:26:17
Update of bug #20273 (project findutils):

                 Summary: xargs -E consumes too much
seekable input => xargs
-E and find -ok consume too much seekable input

    _______________________________________________________

Follow-up 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-cons
umes-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.


    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20273>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





xargs -E and find -ok consume too much seekable input
user name
2007-09-08 07:47:57
Follow-up Comment #5, bug #20273 (project findutils):

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

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20273>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





xargs -E and find -ok consume too much seekable input
user name
2007-09-08 07:50:15
Update of bug #20273 (project findutils):

                  Status:             In Progress =>
Fixed                  

    _______________________________________________________

Follow-up Comment #6:

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

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20273>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





xargs -E and find -ok consume too much seekable input
user name
2007-11-11 13:44:47
Update of bug #20273 (project findutils):

             Open/Closed:                    Open =>
Closed                 
           Fixed Release:                    None =>
4.3.9                  


    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20273>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )