[Ecls-list] [Maxima] segmentation fault with Maxima/ECL
Gabriel Dos Reis
gdr at integrable-solutions.net
Fri Sep 26 03:07:44 UTC 2008
On Thu, Sep 25, 2008 at 9:41 PM, Geo Carncross <geocar at gmail.com> wrote:
> 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, some users would prefer a SIGSEGV to an ever growing stack.
Quite frankly, I think ECL shouldn't try that. It should be left to the user.
>
> However, another possibility is to hook up SIGSEGV as a CL condition,
> and simply give it an alternate (static) stack with sigaltstack()
SBCL reports stack exhaustion without trying to automatically growing it.
More information about the ecl-devel
mailing list