in reply to regexp causes segfault

Just to add one point.

When I tested your regexp with AS5.8.0, it didn't core dump, I guess you used some old version.

It didn't work with AS5.8.0, however it was more robust, and gave a differet msg saying "Complex regular subexpression recursion limit (32766) exceeded".

This makes sense, as they need a way to:
  1. avoid dead loop (better call it dead recursion)
  2. avoid memory allocateion problem

Replies are listed 'Best First'.
Re: Re: regexp causes segfault
by hv (Prior) on Mar 06, 2003 at 04:59 UTC

    This varies depending on platform: perl's configuration script tries to determine the right limit, but doesn't always get it right, and when the limit is too high you'll get the coredump when the real limit is hit.

    It is currently the intention to remove this limitation altogether for perl-5.10.0, by rewiring the regular expression engine to use a new internal stack (which can be grown as needed) rather than the system stack, but it isn't clear yet whether we can do that without slowing down the engine.

    Hugo