Ilya Zakharevich on Wed, 20 Oct 1999 13:36:28 -0400


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

Re: infinite recursion?


On Wed, Oct 20, 1999 at 06:49:22PM +0200, Karim BELABAS wrote:
> GP signal handler gets called at this point, but it also needs a stack
> frame and there's no room for that. Hence a SEGV is .... Boom.
> 
> I see no nice portable way out of this (there's sigaltstack on Solaris as
> Igor pointed), except by having a new default "recurdepth" that would
> specify a maximal recursion depth for GP functions (as in Maple, except its
> value seems to be hardcoded and not user-modifiable).

Perl's Regular Expression engine has/had the same problem.  A month
(or two?) ago somebody send a patch with a portable workaround: get
the stack boundary from OS (it has Configure patches too ;-), and
complain if we are close to the bottom of the pit.  Look on

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/

Ilya