bugfindutils - Bugs: bug #14550, xargs --help breaks with...

 
 

bug #14550: xargs --help breaks with over-large environ

Submitter:  None
Submitted:  Fri 16 Sep 2005 04:19:44 PM UTC
   
 
Category:  xargs Severity:  3 - Normal
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Eric Blake Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.2.25
Fixed Release:  4.2.26
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 16 Sep 2005 04:19:44 PM UTC, original submission:  

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
34664

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).

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-19 jay Open/ClosedOpen Closed
    Fixed ReleaseNone 4.2.26
2005-09-17 jay StatusNone Fixed
    Assigned toNone jay
2005-09-16 None Carbon-Copy- Added ebb9 --AT-- byu --DOT-- net

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code