Bug in Cygwin bash?

Randall R Schulz rrschulz@cris.com
Thu Apr 3 02:43:00 GMT 2003


John,

Yes, there's a limitation on the total volume of argument strings. All 
Unix systems have such a limit and so does Cygwin. The limits vary from 
system to system, though POSIX dictates a minimum value for this limit.

If you've got to deal in some kind of open-ended argument list (lists 
of file names generated by find is probably the most common case), then 
you must deal with the fact that there's a limit to how many you can 
pass in a single command invocation.

For cases where the total list of files can be processed in pieces, the 
xargs command will do the divvying up for you, invoking the command as 
many times as needed to process all the arguments it reads from 
standard input. Check it out--it should be in your script-writing repertoire.

In cases where all of the arguments must be processed in a single 
invocation some accommodation must be made by the program that 
processes those strings. A typical approach is to accept arguments held 
in lines of a text file.

Good luck.

Randall Schulz


At 18:06 2003-04-02, John Williams wrote:
>Hi folks,
>
>I've found a bizarro error that may in fact relate to 
>Cygwin/bash.  I'm using the latest version (ran setup and refreshed 
>just yesterday).
>
>In the linux kernel configuration process, there is a rule in 
>/linux-2.4.x/makefile that looks like this:
>
>dep-files:
>     scripts/mkdep -- `find .....` > .hdepend
>
>The find command returns a huge list of header files, from which 
>dependencies are derived.
>
>After some digging I've found that it fails when the length of the 
>string returned by `find...` exceeds about 32K characters.  It doesn't 
>seem to matter how many file names are returned, just the total length 
>of the string that contains them all.
>
>This may be a bug in the mkdep utility, but I suspect more that it 
>might be a limitation in Cygwin or bash.  Is there some fundamental 
>limitation to the length of the argv[] array when launching programs 
>under Cygwin/bash?
>
>I created a workaround by doing
>
>dep-files:
>     rm -f .hdepend
>     find .... | xargs scripts/mkdep -- >> .hdepend
>
>But this means I need to patch over the standard linux build 
>distribution before doing anything under Cygwin.
>
>Can anyone confirm or deny?! :)
>
>Cheers,
>
>John


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list