-
-
Notifications
You must be signed in to change notification settings - Fork 657
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
Regex stack overflow in Neko/HL #10867
Comments
I tested with a nightly build of neko, where the regex engine has been updated to The migration is still not complete for Hashlink, however, it can be tested with this PR, which also seems to fix it for me: HaxeFoundation/hashlink#515 It's likely to fail also on Eval and Lua, which also still use |
This is just another reason to make the pcre2 migration. Lua should not be that hard to get updated but Eval will be considerably harder (since it requires a currently nonexistent Ocaml binding for pcre2). |
Lua issue seems to be fixed with #11030 |
My bad, I must have been using a build of neko from this PR: HaxeFoundation/neko#262, so it will have to be merged for the neko tests to pass. This looks like this could have the same root cause as #8829. |
That helped, thanks! |
In my quest to write the most cursed regexes, I found one that breaks on moderately sized strings.
This looks to be an issue in the regex libs itself, though I'm filing here as a first point of contact, since I don't have a good way to test if it's due to some shenanigans on our end or not.
Test case:
Or if you prefer, a try.haxe link: https://try.haxe.org/#cAfb5b04
This code works fine in Javascript and python, I've not tested other platforms yet. However, both Neko and HL fail (Neko simply aborts, Hashlink throws an unrecoverable stack overflow exception.
If you wind down the iterations it'll succeed, so it's limited to longer string lengths.
The text was updated successfully, but these errors were encountered: