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.
Created attachment 104958 [details]
Patch to add XARGS_ARG_MAX_LIMIT environment variable
How about just changing this to 128k? That's what ARG_MAX actually is I think.
And removing the "sanity check" altogether? Sounds fine to me.
Created attachment 105444 [details]
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).
*** Bug 180896 has been marked as a duplicate of this bug. ***
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.