I wrote: > > (show-file-name #t stack 40000 debug backtrace depth 100 maxdepth 1000 > > frames 3 indent 10 width 79 procnames cheap) > > Notice the "stack 40000", which means that the stack limit (as far as > guile is concerned) is only 40000 words, i.e. 160 kilobytes. Other > times, I see much larger numbers there, which are close to the actual > stack resource limit (as set by setrlimit), and in those cases the > stack doesn't overflow.
It turns out that 40000 is the initial value of guile's internal stack limit, as part of the definition of scm_debug_opts[] in eval.c. That value is supposed to be overwritten by init_stack_limit() in debug.c, but it will be left unchanged if getrlimit() fails, or if both the hard and soft stack limits are set to infinity. I suggest increasing the initial value of 40000 to something more reasonable, perhaps 128000 words (which is approximately what my system needs to successfully compile the ecmascript code), and printing an error message if getrlimit fails. Mark