-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Dave B on 8/28/2008 9:24 AM: > > If I replace 3332 with 3333, bash gives > > bash: line 1: syntax error near unexpected token `|' > > Curiously, with this command > > (printf 'echo a';for i in `seq 1 3330`;do printf '|(read a;echo $a)'; > done;echo) | bash > > the limit is 3330.
Another limit is 2499 for nested elif constructs within a single if/fi (I hit that when trying to stress-test autoconf). These limits are probably determined by bison, which defines YYMAXDEPTH to 10000 if not otherwise specified, where the 10000 is then divided by how many tokens appear in the recursion sequence. The alternative to these arbitrary limits is unbounded stack growth, but without the use of GNU libsigsegv, it is very difficult to distinguish stack overflow from real SEGV on many modern architectures (including Linux). > > Ulimit tells me that the maximum number of user processes is 16381, so it > seems unrelated to that. But not all platforms support that many simultaneously open pipes; so on other platforms, the limit will be smaller than the bison-enforced parser limit. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAki3e70ACgkQ84KuGfSFAYAyxACeLKWPiKzn8MHf+PjHAEstGAG5 RsIAn2LFqSGuNmZDsxbPaMEZzVikYG6R =OFih -----END PGP SIGNATURE-----