[Top][All Lists]

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

[bug #14550] xargs --help breaks with over-large environ

From: anonymous
Subject: [bug #14550] xargs --help breaks with over-large environ
Date: Fri, 16 Sep 2005 16:19:45 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)


                 Summary: xargs --help breaks with over-large environ
                 Project: findutils
            Submitted by: None
            Submitted on: Fri 09/16/05 at 16:19
                Category: xargs
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Eric Blake
        Originator Email: address@hidden
             Open/Closed: Open
                 Release: 4.2.25
           Fixed Release: None



Background: A recent cygwin bug report exposed a flaw in some Windows
versions - Windows does not document a maximum environment size, only that
individual environment variables must not exceed 32k; meanwhile the command
line is in independent memory from environ and is capped at 32k.  This does
not map very well to cygwin and the idea of ARG_MAX.  As a result, it is
possible to have an environment that exceeds 32k, but which is still seen by
the child process.  For an example:
$ foo=`perl -e 'print "a"x31000'`
$ export foo
$ /bin/env | wc -c

Bug: xargs ALWAYS tries to calculate its buffer range, prior to parsing argv.
 As a result, when the environment leads to an impossible situation (such as
cygwin having a larger environment than the useful 32k ARG_MAX), --help no
longer works:
$ xargs --help
xargs: environment is too large for exec
$ xargs --version
xargs: environment is too large for exec

Instead, xargs should parse argv FIRST, because --help and --version should
not fail (since xargs does not have to exec any subprocess).


Carbon-Copy List:

CC Address                          | Comment
ebb9 --AT-- byu --DOT-- net         | Originator Email


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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