Skip Menu |
Report information
Id: 123465
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Sat, 20 Dec 2014 22:10:12 +0100
Subject: [BUG] /+/ is invalid as a literal regex, but causes an infinite loop when passed in as an indirect subrule call in Rakudo
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 734b
<masak> heh, I think I found a bug in the regex engine :) <masak> m: /+/; say "alive" <camelia> rakudo-moar fb9127: OUTPUT«===SORRY!=== Error while compiling /tmp/MtEpSUUPer␤Quantifier quantifies nothing [...] <masak> m: my $rx = "+"; "" ~~ /<$rx>/; say "alive" <camelia> rakudo-moar fb9127: OUTPUT«Memory allocation failed; could not allocate 929136640 bytes␤» * masak submits rakudobug <masak> my assumption here is the /+/ is still a syntax error, even if it happens through an injected regex. S05 says "If the compilation of the string form fails, the error message is converted to a warning and the assertion fails." So, it shouldn't die, just fail the match. It definitely shouldn't loop forever and run out of memory.
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 558b
This dies now with the same typed exception: $ perl6 -e 'my $rx = "+"; "" ~~ /<$rx>/; say "alive"' ===SORRY!=== Error while compiling EVAL_0 Quantifier quantifies nothing at EVAL_0:1 ------> anon regex { +⏏} But as masak pointed out, S05 says it should not die: On Sat Dec 20 13:10:32 2014, masak wrote: Show quoted text
> [...] > S05 says "If the compilation of the string form fails, the error > message is converted > to a warning and the assertion fails." > > So, it shouldn't die, just fail the match. It definitely shouldn't > loop forever and run out of memory.
Still dies the same way.

On 2015-04-25 06:34:23, bartolin@gmx.de wrote:
Show quoted text
> This dies now with the same typed exception:
>
> $ perl6 -e 'my $rx = "+"; "" ~~ /<$rx>/; say "alive"'
> ===SORRY!=== Error while compiling EVAL_0
> Quantifier quantifies nothing
> at EVAL_0:1
> ------> anon regex { +⏏}
>
> But as masak pointed out, S05 says it should not die:
>
> On Sat Dec 20 13:10:32 2014, masak wrote:
> > [...]
> > S05 says "If the compilation of the string form fails, the error
> > message is converted
> > to a warning and the assertion fails."
> >
> > So, it shouldn't die, just fail the match. It definitely shouldn't
> > loop forever and run out of memory.




This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org