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

Using quantifiers with zero-width regex elements runs until out of memory #2806

Open
Kaiepi opened this issue Mar 31, 2019 · 2 comments

Comments

Projects
None yet
4 participants
@Kaiepi
Copy link
Contributor

commented Mar 31, 2019

The Problem

See title.

Expected Behavior

An exception should be thrown.

Actual Behavior

The code will run until the process runs out of memory.

Steps to Reproduce

bastille% perl6 -e "'If two astronauts were on the moon and one bashed the other\'s head in with a rock would that be fucked up or what?' ~~ / <wb>+ /" 
MoarVM panic: Memory allocation failed; could not allocate 36864 bytes

Environment

  • Operating system:
    OpenBSD bastille.kennel.qt 6.4 GENERIC.MP#683 amd64
  • Compiler version (perl6 -v):
    This is Rakudo version 2019.03 built on MoarVM version 2019.03
    implementing Perl 6.d.
@AlexDaniel

This comment has been minimized.

Copy link
Member

commented Mar 31, 2019

@vendethiel

This comment has been minimized.

Copy link
Contributor

commented Apr 1, 2019

In all but the simplest cases, this seems like a NP-hard problem to solve.

@lucasbuchala lucasbuchala added the regex label Apr 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.