[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stack Overflow



> I too have the same problem of getting "Stack Overflow" when running a
> program that I know works...
> Any insight into this puzzling problem would be much appreciated.

I don't know if this is the cause of your problem, but recursion is
frequently the culprit here. Specifically, any recursive function should
be both 1) properly tail-recursive and 2) compiled with 
(declare (optimize (debug 2))) or lower so that the compiler will
replace the recursive call with a jump. Any recursive function that
does not meet both these criteria can potentially cause stack overflow
if it recurs too much.

-- 
Shannon Spires
svspire@sandia.gov