Re: Argument list too long: out of environment space

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Thu Mar 02 2000 - 19:34:36 EST


Stuart Inglis wrote:
> /*
> * MAX_ARG_PAGES defines the number of pages allocated for arguments
> * and envelope for the new program. 32 should suffice, this gives
> * a maximum env+arg of 128kB w/4KB pages!
> */
> #define MAX_ARG_PAGES 32
>
> This seems to be the cause of our problem. When the total size of the
> command line is over 128kB we start encountering this problem.
>
> Can this value be safely increased? Does it need to be constant at all?

Yes it can be increased. I had a project with 1MB command lines, so we
increased MAX_ARG_PAGES and everything was fine. Until our command
lines grew too long again... :-)

We looked for a way to use smaller command lines. Not xargs -- that
didn't do the right thing. We could change our commands to read the
list of files, but we didn't find a way to convince Make to write the
**ing list of files to a file. "echo $(FILES) > listfile" doesn't work
for the obvious reason.

I was really tempted to add a $(echo $(FILES)) function to GNU Make to
get around this.

But the quicker solution at the time was to increase MAX_ARG_PAGES and
it was fine.

Feel free to remove the limit altogether and make it dynamic. Something
involving an extra struct mm which you are filling up ptrace-style might
be appropriate. It must be pageable if it can be arbitrarily large.

have a nice day,
-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:13 EST