[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua5.1: Lua stack is too small for a script that takes over 2048 arguments
- From: Duck <duck@...>
- Date: Thu, 20 Dec 2007 21:17:41 +1100 (EST)
Well, Linux 2.6 itself has a limit of 32K entries in *argv[], which has
always struck me as annoying...it's not unusual these days to have a
laptop with 2GB of physical RAM and to have executables which are 10s of
MB in size, so 128KB and 32K entries for *argv[] seems kinda old
fashioned...
However, I find the reason I generally want to pass 32KB or more args to a
program is through aggressive use of globs, for example, a list of
filenames to scan for viruses.
For this sort of use, I don't particularly care whether the limit is 2KB
or 32KB -- the issue is that there is an arbitrary limit. (And, as you
point out, a wildly varying limit depending on your OS flavour -- though I
see that GNU/Hurd has unlimited command line lengths, so when Hurd is
finished, which should happen by, say, 1994,, I'll probably switch to it
:-)
Where I expect a program or script to be used with more than even just a
few dozen arguments (usually filenames) I invariably give up and either
make the script accept '@filename' as 'now read arguments out of filename
to any reasonably enormous number' or (if the script is not a filter) take
the filename arguments via stdin and the configuration args via the
command line...
So by all means bump 2048 up to 32K (a handly match for Linux 2.6) but it
doesn't really fix anything.