Closed p5pRT closed 20 years ago
The following program causes a segmentation violation:
$_ = 'X' x 50000; /(?:XX|X)*/;
This regexp bug can _still_ cause a segfault in bleadperl as of today.
--cut-- #!/usr/local/bin/perl
$_ = 'X' x 50000; /(?:XX|X)*/; --cut--
In \20000918115335\.A27376@​athenaeum\.globnix\.org\, Michael Stevens writes: :This regexp bug can _still_ cause a segfault in bleadperl as of today. : :--cut-- :#!/usr/local/bin/perl : :$_ = 'X' x 50000; :/(?:XX|X)*/;
Yes\, this is not likely to be fixed any time soon: the recursion exceeds your stack size. Increasing the stack size for perl may allow you to match longer strings before it breaks\, but a fix involves flattening the recursion out of the regexp matcher\, which is a) difficult and b) not of the highest priority. But patches welcome\, of course. :)
Hugo
On Mon\, Sep 18\, 2000 at 01:33:17PM +0100\, Hugo wrote:
Yes\, this is not likely to be fixed any time soon: the recursion exceeds your stack size. Increasing the stack size for perl may allow you to match longer strings before it breaks\, but a fix involves flattening the recursion out of the regexp matcher\, which is a) difficult and b) not of the highest priority. But patches welcome\, of course. :)
It would be nice if it could at least say "this is too big\, I give up".
Code wise\, the regexp stuff scares me.
Michael.
In \20000918141050\.A29064@​athenaeum\.globnix\.org\, Michael Stevens writes: :On Mon\, Sep 18\, 2000 at 01:33:17PM +0100\, Hugo wrote: :> Yes\, this is not likely to be fixed any time soon: the recursion exceeds :> your stack size. Increasing the stack size for perl may allow you to :> match longer strings before it breaks\, but a fix involves flattening :> the recursion out of the regexp matcher\, which is a) difficult and b) :> not of the highest priority. But patches welcome\, of course. :) : :It would be nice if it could at least say "this is too big\, I give up". : :Code wise\, the regexp stuff scares me.
It should do: that is what the REG_INFTY stuff is there for. However it is difficult (impossible?) for Configure to determine the right value to set REG_INFTY to - I believe it is usually too high under Linux\, for example - and I have seen suggestions that the REG_INFTY check may not be triggered when it should in all cases.
HTH\,
Hugo
still core dumps in bleadperl as of 18/sep/2000\, perl 5.7.0 DEVEL7093
Migrated from rt.perl.org#938 (status was 'resolved')
Searchable as RT938$