develooper Front page | perl.perl5.porters | Postings from March 2016

[perl #126182] /(.(?2))((?<=(?=(?1)).))/ hangs and eats allavailable RAM

Thread Next
From:
James E Keenan via RT
Date:
March 1, 2016 23:58
Subject:
[perl #126182] /(.(?2))((?<=(?=(?1)).))/ hangs and eats allavailable RAM
Message ID:
rt-4.0.18-18061-1456876699-1152.126182-15-0@perl.org
On Tue Oct 13 23:05:46 2015, victor@drawall.cc wrote:
> My bad, my “How to reproduce section” is wrong. When matched against
> an empty string, the regex will fail immediately, as expected. The
> problems only start when it is applied to a non-empty string, as in :
> 
> perl -e '"a"=~/(.(?2))((?<=(?=(?1)).))/'
> 
> I’ve just reproduced it on the latest blead
> (f83e001e339db3eb180f5f1918c268681665839d).
> 
> I’d recommend doing a `ulimit -Sv 1048576` or some such before running
> the command, to prevent it from getting out of control.
> 

And here it is at today's blead (on Linux x86_64):
#####
$ git show | head -1
commit f24480bcc6bbe9061c0ff1595df8d3eadb2ab8db

$ ulimit -Sv 1048576 && ./perl -Ilib -e '"a"=~/(.(?2))((?<=(?=(?1)).))/'
Out of memory!
#####

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=126182

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About