This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 135129 - xargs arg_max limit is too small for some environments
xargs arg_max limit is too small for some environments
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: findutils (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
: FutureFeature
: 180896 (view as bug list)
Depends On:
Blocks: 168426
  Show dependency treegraph
 
Reported: 2004-10-08 17:15 EDT by Manish Singh
Modified: 2009-07-17 07:17 EDT (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2006-0030
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-15 10:42:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to add XARGS_ARG_MAX_LIMIT environment variable (1.19 KB, patch)
2004-10-08 17:16 EDT, Manish Singh
no flags Details | Diff
findutils-arg-size.patch (1.88 KB, patch)
2004-10-19 07:31 EDT, Tim Waugh
no flags Details | Diff

  None (edit)
Description Manish Singh 2004-10-08 17:15:43 EDT
xargs has the following code:

  /* Sanity check for systems with huge ARG_MAX defines (e.g., Suns which
     have it at 1 meg).  Things will work fine with a large ARG_MAX but it
     will probably hurt the system more than it needs to; an array of this
     size is allocated.  */
  if (arg_max > 20 * 1024)
    arg_max = 20 * 1024;

For some environments with tons of variables (like, the oracle
development environments), 20k is simply too small. The attached patch
makes this upper limit configurable.
Comment 1 Manish Singh 2004-10-08 17:16:36 EDT
Created attachment 104958 [details]
Patch to add XARGS_ARG_MAX_LIMIT environment variable
Comment 2 Tim Waugh 2004-10-15 10:54:31 EDT
How about just changing this to 128k?  That's what ARG_MAX actually is I think.
Comment 3 Manish Singh 2004-10-15 12:19:20 EDT
And removing the "sanity check" altogether? Sounds fine to me.
Comment 4 Tim Waugh 2004-10-19 07:31:54 EDT
Created attachment 105444 [details]
findutils-arg-size.patch

Actually findutils-4.2.1 handles this differently.  I have back-ported the
change to findutils-4.1.20, and attached it here.  This patch has been applied
in Fedora devel (4.1.20-7).
Comment 24 Miloslav Trmač 2006-02-13 12:11:37 EST
*** Bug 180896 has been marked as a duplicate of this bug. ***
Comment 25 Red Hat Bugzilla 2006-03-15 10:42:32 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0030.html

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