Robert William Leach <[EMAIL PROTECTED]> wrote:
:I get the same segmentation fault behavior when I run it myself and I
:have an idea what is going on here. This specific regular expression
:limitation is not mentioned in the documentation, but it has to do with
:a maximum limit inside the curly braces. The string of N's in your
:sequence being matched against is exceeding that limit. This is the
:line of code that is causing the segmentation fault when it reaches
:that string of N's:
:
: while($seq =~ /((.{$unit_size})\2{$minunits,})(.{0,$unit_size})/g)
:
:My guess is that when the string matches "\2{$minunits,}" more than a
:certain number of times, you get a segmentation fault, but in perl's
:regular expression documentation, the limit is said to be on the
:numbers used in the curly braces, not the length of the string itself.
:At the time of the fault, $minunits is 10 and $unit_size is also 2, so
:it's the string being matched that is causing the code to choke.
The limit of around 32766 is the only explicit limit. The implicit limit,
which is what is causing the segfault, is the size of the C stack - the
regular expression engine uses recursive function calls in the C code,
and if the code recurses too deeply it overflows the stack.
The intention is eventually to replace the current implementation with
one that avoids this problem, but that is unlikely to happen in time
for the next major release (perl-5.10). In the meantime, you can usually
extend the available range by using OS tools to increase the size of
the stack available to perl.
You'll find some additional information in the bugs database at
<https://guest:[EMAIL PROTECTED]/rt3/Ticket/Display.html?id=24274>.
Hugo