develooper Front page | perl.perl5.porters | Postings from January 2005

Re: [perl #33945] Segmentation fault with deep recursion in regex engine

Thread Next
From:
A. Pagaltzis
Date:
January 29, 2005 17:44
Subject:
Re: [perl #33945] Segmentation fault with deep recursion in regex engine
Message ID:
20050129193348.GA20925@klangraum
* Dave Mitchell via RT <perlbug-followup@perl.org> [2005-01-29 19:14]:
> No. we're talking about the processor stack here, not the Perl
> stack. That would imply that every function call that perl ever
> makes (and in any libraries that is uses) must check first,
> which would grind things to a halt.

Sure, but we're not talking about every conceivable scenario.
This is a specific case, namely the evaluation of a postponed
regular expression. Isn't it possible to insert a guard that is
checked before the engine evaluates a postponed expression?

Or to put this in another way: could I write a straight regular
expression *without* postponed expressions that is so large as to
cause perl to segfault just as it does here?

> No, because by the time of a SIGSEGV, perl can't execute any
> code that might call a function, because it hasn't got a stack.

I am well aware of that. The goal would of course be to recognise
the situation before the segfault happens in the first place.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About