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

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

Thread Next
A. Pagaltzis
January 29, 2005 17:44
Re: [perl #33945] Segmentation fault with deep recursion in regex engine
Message ID:
* Dave Mitchell via RT <> [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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About