On Thu, Dec 02, 2004 at 10:33:12PM +0000, Jonathan Paton wrote:

> Couldn't leave this one alone :)  I now have a minimised test case:
> 
> $msgs = '1' x 100000;
> $msgs =~ /(1_?)*/;
> 
> I believe the issue is related to an incorrect optimisation of the regex.

Why do you think that?  I suspect that you are just blowing the stack.
You're asking the RE engine to store an awful lot of backtracking
information.  How much stack space are you giving it?

$ limit stacksize

If it's 8M or so, you might want to try increasing it.

$ ulimit stacksize

if you are feeling adventurous.  Or something smaller if you prefer.

The same probably applies to the original poster's problem.

But it's probably better not to write regular expressions which need
that much stack.  Something like

  die if /[^\d,]/ || /^,/ || /,,/;

> I strongly recommend perlbug.  I will add to it.

There are already a number of stack blowing RE bugs in the db.  If you
want to add this one, could you try and find an existing similar bug and
add your code as a test case?

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to