[Ecls-list] segmentation fault with Maxima/ECL



On Sun, Sep 28, 2008 at 6:34 PM, Juan Jose Garcia-Ripoll <
juanjose.garciaripoll at googlemail.com> wrote:

> On Fri, Sep 26, 2008 at 3:05 PM, Stavros Macrakis <macrakis at alum.mit.edu>
> wrote:
> > On Wed, Sep 24, 2008 at 4:29 PM, Juan Jose Garcia-Ripoll
> > <juanjose.garciaripoll at googlemail.com> wrote:
> >>
> >> The problem is that there is no portable way of detecting a stack
> overflow
> >> ...
> > Infinite recursions are a common bug in Lisp programs, and Lisp is
> usually
> > used interactively, so Lisp implementations that can't detect stack
> overflow
> > and recover gracefully are pretty much useless.  I would recommend that
> you
> > find a way to detect stack overflow, even if there is no portable
> solution,
> > and you have to write different code on different platforms.
>
> Ok, let me state it this way. The interpreter right now detects stacks
> overflows. Right now, and with all the changes from this weekend, the
> only case in which stack overflows are not going to be detected is
> when you compile code to C and this code does not make use of CATCH,
> BLOCK, UNWIND-PROTECT, TAGBODY and does not define and bind special
> variables. The rest of cases are not covered but that is a pretty
> small set and those who compile code should already know what they do.
>

So most compiled code does not check for stack overflows?  That is not
acceptable for a serious modern language implementation.  (Though it may be
OK for low-level languages.)

And as for the "portable" solution... "portable" means that there is a
> simple solution which is covered by standard C or whatever programming
> language I use, so that I do not have to go through the manuals of
> each of the supported platforms and chipsets, which currently are
> Windows, NetBSD, FreeBSD, OpenBSD, Linux, Mac OS X and Solaris.
>
> Now, for the record and for the future, please refuse to use so
> lightly the sentence "even if there is no portable solution, and you
> have to write different code on different platforms".
>

I have designed and written compilers and run-time systems for a variety of
languages (Lisp, Ada, Pascal, Chill, ...) on a variety of platforms, and am
well aware of the problems of writing portable code.  I agree entirely that
writing different code is unpleasant, and should be a last resort, but if
important functionality cannot be provided any other way, this is what you
have to do.  Not necessarily you personally, of course; it is usually
possible to find collaborators on open source projects who will help out.
After all, Maxima itself works on a variety of Lisp platforms, and in a few
cases needs implementation-specific code.

If important functionality is missing -- and stack overflow detection is
pretty important -- the user doesn't really care *why* it is missing.  It
will remain a toy implementation until the functionality is provided
somehow.

             -s