Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/+/ is invalid as a literal regex, but causes an infinite loop when passed in as an indirect subrule call in Rakudo #3615

Open
p6rt opened this issue Dec 20, 2014 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 20, 2014

Migrated from rt.perl.org#123465 (status was 'open')

Searchable as RT123465$

@p6rt
Copy link
Author

p6rt commented Dec 20, 2014

From @masak

<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.

@p6rt
Copy link
Author

p6rt commented Apr 25, 2015

From @usev6

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.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Apr 25, 2015

From @usev6

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.

@p6rt
Copy link
Author

p6rt commented Apr 25, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 13, 2017

From @AlexDaniel

Still dies the same way.

On 2015-04-25 06​:34​:23, bartolin@​gmx.de wrote​:

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.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant