Andrew Makhorin wrote:
Yes, probably it would be reasonable to add such check to avoid silly
errors. BTW, this check may be performed on the translation phase.
In more general case to prevent infinite recursion on computing indexed
sets/parameters the maximum recursion level could be limited to some
predefined value. (I added this note to the todo list.)


Hello Andrew,

the allowable recursion depth will depend on the stack size.

set A := {0..99999};
param p{a in A} := if a == 4 then 5 else p[(a-1) mod 100000];
display p;

ran fine on my Ubuntu PC after issuing
$ ulimit -s 100000000
to reserve 100 MBytes for stack.

gcc has a flag -fstack-check. It might make sense to compile with this flag.

I found the following information in
http://cs.nyu.edu/exact/core/doc/stackOverflow.txt

How to change the default stack size on different platforms:
In general, under Unix-like platforms, the stack size is controlled
by environment variable, not the program itself.
So you cannot pass any flags to the
compilers, like gcc, to setup stack size. Under Windows platforms, the
stack size information is contained in the executable files.

Best regards

Xypron


_______________________________________________
Bug-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-glpk

Reply via email to