[Maxima] [Ecls-list] segmentation fault with Maxima/ECL

Geo Carncross geocar at gmail.com
Thu Sep 25 21:41:00 CDT 2008

On Thu, Sep 25, 2008 at 2:38 PM, Juan Jose Garcia-Ripoll
<juanjose.garciaripoll at googlemail.com> wrote:
> C in general provides no useful ways to control the stack size, other
> than inspecting the address of automatic variables and guessing the
> consumed stack. However this does not _enlarge_ it, it just gives you
> a clue that you will be approaching some limits. What limits? Well
> setting up such a check is stupid if we use a limit which is much
> larger than usual stack size limits. Perhaps this could be guessed at
> configuration time and later on left as a configurable parameter.

New stacks can (trivially) be created with pthread_attr_setstacksize()
or pthread_attr_setstack()

Something often overlooked is that setrlimit() can set the stack size.
Simply set RLIMIT_STACK to (RLIM_INFINITY) unlimited and Linux (and
most other systems) will grow it as necessary - at least until it
collides with the heap.

However, another possibility is to hook up SIGSEGV as a CL condition,
and simply give it an alternate (static) stack with sigaltstack()

More information about the Maxima mailing list