Marcin Mielżyński

Results 11 comments of Marcin Mielżyński

using =~ seems to match properly, so the problem seems to be related to advancing in either scan or subsequent joni match

split also hangs, so it's a joni issue

I can reproduce this in onigmo using subsequent match via: ``` onig_search(reg, str, (str + SLEN(str)), str + 12, (str + SLEN(str)), &region, ONIG_OPTION_NONE); ``` The problem is that we...

so after a quick&dirty https://gist.github.com/lopex/be0d7fddf2eabb62ee371f9beb9ca47b and using: ``` onig_search(reg, str + 12, (str + SLEN(str)), str, (str + SLEN(str)), &region, ONIG_OPTION_NONE); ``` produces: onig_search (entry point): str: 4299173916 (0x10040301c), end:...

for the former case, after shortenning the input a bit: ``` "foo========:bar baz==========================bingo" ``` joni also completes, after w few seconds.

this is related to https://github.com/jruby/jcodings/issues/25, until we'll have unsave and approximate length routines, we will be plagued by such cases.

I'm reluctant to such changes since they will introduce inconsistencies and diverge us from onigmo even more. The problem is explained more thoroughly in https://github.com/jruby/jcodings/issues/26

Also, https://github.com/jruby/jcodings/issues/26 shows that those infinite loops will exist in other places and it would not be ideal to randomly patch susceptible callsites.

For this very case, a quick fix would be to add an unsafe GB18030 version in the same fashion https://github.com/jruby/jcodings/tree/unsafe-encoding aims to.

Maybe the syntax settings just needs fixing ?