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

Re: Stack overflows (was: Re: Future of Debian uncertain?)



Craig Dickson <crdic@pacbell.net> writes:

> Falk Hueffner wrote:
> > It's not that difficult to hit when you do functional style
> > programming, e. g.
> 
> You clipped the context enough that I'm not quite sure what you mean by
> "it", but from the subject I'll assume "it" is a stack overflow. In
> which case functional programming is actually _less_ likely to require a
> huge stack if you have tail recursion and know how to use it.

Well, it's often too much hassle to write tail recursive.

> Also, most functional languages, in my experience, don't use a
> statically-allocated stack for subroutine call returns.

Ocaml does. It uses the plain OS-provided stack.

> > It would already be quite helpful IMHO if one didn't just get a
> > SEGV, since that usually indicates a program error.  I don't think
> > there are any free signal numbers, though. Maybe one should send
> > SIGBUS or something?
> 
> A stack overflow is not a bus error. It's a segment violation. And quite
> often, a stack overflow _is_ a program error.

Still it'd be nice IMHO to differentiate it from other segment
violations.

-- 
	Falk



Reply to: