Bug 135129 - xargs arg_max limit is too small for some environments
Summary: xargs arg_max limit is too small for some environments
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: findutils
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
: 180896 (view as bug list)
Depends On:
Blocks: 168426
TreeView+ depends on / blocked
 
Reported: 2004-10-08 21:15 UTC by Manish Singh
Modified: 2009-07-17 11:17 UTC (History)
4 users (show)

Fixed In Version: RHBA-2006-0030
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-15 15:42:32 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0030 0 qe-ready SHIPPED_LIVE findutils bug fix update 2006-03-14 05:00:00 UTC

Description Manish Singh 2004-10-08 21:15:43 UTC
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 21:16:36 UTC
Created attachment 104958 [details]
Patch to add XARGS_ARG_MAX_LIMIT environment variable

Comment 2 Tim Waugh 2004-10-15 14:54:31 UTC
How about just changing this to 128k?  That's what ARG_MAX actually is I think.

Comment 3 Manish Singh 2004-10-15 16:19:20 UTC
And removing the "sanity check" altogether? Sounds fine to me.

Comment 4 Tim Waugh 2004-10-19 11:31:54 UTC
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 17:11:37 UTC
*** Bug 180896 has been marked as a duplicate of this bug. ***

Comment 25 Red Hat Bugzilla 2006-03-15 15:42:32 UTC
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.