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

doubleQuotedString hits recursion limit on longer strings #41

Closed
excursus opened this issue Feb 24, 2021 · 3 comments · Fixed by #42
Closed

doubleQuotedString hits recursion limit on longer strings #41

excursus opened this issue Feb 24, 2021 · 3 comments · Fixed by #42

Comments

@excursus
Copy link

Running the string.doubleQuotedString parser on long-ish strings causes it to hit the recursion limit. I tried getting around this by writing a regex to match such a string, but since streams of strings are arrays of characters, there is no way to match that regex to a string longer than a single character.

Is there some official workaround for this? Thanks!

@IMax153
Copy link
Collaborator

IMax153 commented Feb 24, 2021

Hey @excursus! Thanks for the issue!

Could you provide and example of a string on which the doubleQuotedString Parser is failing? It will help with testing a fix for the issue. Thanks!

@excursus
Copy link
Author

Sure! I think the any string that is long enough will do it, although I imagine that "long enough" is runtime specific. For instance this will do it:

"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam egestas diam at augue tincidunt ultrices. Phasellus sagittis dictum sem, eu fermentum tellus auctor sit amet. Mauris ac scelerisque felis, nec tempor lectus. Cras rutrum massa non ligula vulputate, ut rutrum nibh efficitur. Sed pellentesque, orci ut malesuada tincidunt, mauris ex blandit eros, quis posuere magna augue auctor nulla. Aenean ut dui elit. Vestibulum convallis lacinia posuere. Donec id mollis turpis. Curabitur aliquam urna vel ligula posuere, ut lacinia urna imperdiet. Praesent auctor lectus quis mi elementum varius. Suspendisse tortor nunc, iaculis sed venenatis non, imperdiet id lacus. Quisque sodales suscipit nibh in consectetur. Quisque eget lacinia massa, porttitor dictum nisi. Pellentesque at orci fringilla, ornare mi gravida, vulputate eros. Vestibulum pharetra ornare accumsan. Donec lacinia diam erat, ut feugiat quam semper in. Nulla vel velit urna. Suspendisse id elit odio. Curabitur posuere mauris nulla, non elementum nulla maximus quis. Duis erat eros, tincidunt et fermentum eget, efficitur sit amet diam. Donec placerat, felis non elementum pretium, ipsum sapien rhoncus ipsum, ac convallis justo odio id dui. Vivamus convallis tellus ut turpis pretium, at volutpat orci eleifend. Pellentesque porttitor vitae leo quis auctor. Donec tincidunt, lectus a sagittis efficitur, velit arcu varius eros, vitae interdum diam ex et ipsum."

where it throws RangeError: Maximum call stack size exceeded.

@IMax153
Copy link
Collaborator

IMax153 commented Feb 25, 2021

Thanks for the bug report @excursus! You actually helped me identify a bug in the ChainRec implementation for Parser as well! Follow #42 for more info on when the fix will be released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants