Skip to content

Unable to find org.jcodings.specific.BaseUTF8Encoding.mbcCaseFold #25

Closed

Description

@ahorek

hi @lopex
the recent mail build started to fail
https://travis-ci.org/mikel/mail/jobs/435704866
https://github.com/mikel/mail

not sure if the problem is in joni or jcodings. If you have time, please take a look, thanks.

Failure/Error: Unable to find org.jcodings.specific.BaseUTF8Encoding.mbcCaseFold(BaseUTF8Encoding.java to read failed line
     
     Java::JavaLang::ArrayIndexOutOfBoundsException:
       -2
     # org.jcodings.specific.BaseUTF8Encoding.mbcCaseFold(BaseUTF8Encoding.java:152)
     # org.jcodings.specific.UTF8Encoding.mbcCaseFold(UTF8Encoding.java:22)
     # org.joni.Search.lowerCaseMatch(Search.java:42)
     # org.joni.Search.access$000(Search.java:27)
     # org.joni.Search$11.search(Search.java:439)
     # org.joni.Matcher.forwardSearchRange(Matcher.java:137)
     # org.joni.Matcher.searchCommon(Matcher.java:425)
     # org.joni.Matcher.search(Matcher.java:301)
     # org.jruby.RubyRegexp.matcherSearch(RubyRegexp.java:231)
     # org.jruby.RubyRegexp.search(RubyRegexp.java:1306)
     # org.jruby.RubyRegexp.matchPos(RubyRegexp.java:1195)
     # org.jruby.RubyRegexp.op_match(RubyRegexp.java:1113)
     # org.jruby.RubyString.op_match(RubyString.java:1656)
     # org.jruby.RubyString$INVOKER$i$1$0$op_match.call(RubyString$INVOKER$i$1$0$op_match.gen)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
     # home.travis.build.mikel.mail.lib.mail.encodings.invokeOther6:=~(/home/travis/build/mikel/mail/lib/mail/encodings.rb:125)
     # home.travis.build.mikel.mail.lib.mail.encodings.RUBY$method$value_decode$0(/home/travis/build/mikel/mail/lib/mail/encodings.rb:125)
...

Activity

  1. lopex commented on Oct 2, 2018

    @lopex
    Contributor

    reduced case:

    "\u{1F48C}" =~ /\=\?/i
  2. lopex commented on Oct 2, 2018

    @lopex
    Contributor

    This is related to jruby/joni#17, Onigmo appears to compare first two bytes of "\u{1F48C}" to "=?" in exact info regexp field (used by fast skip algorithms). It uses for that mbclen(enc, p, end) function aka onigenc_mbclen_approximate which will never return negative values and acts as a safeguard for broken characters.

  3. lopex commented on Oct 2, 2018

    @lopex
    Contributor

    The issue was introduced with jruby/joni@012bb20 which turned on Search.BM_IC fast skip boyer-moore / sunday case insensitive search routine. The problem doesnt seem to be in the routine itself, but how case insensitive comparison is being handled. Until we find the solution we can fallback to Search.SLOW_IC for now.

  4. lopex commented on Oct 3, 2018

    @lopex
    Contributor

    Temporary fix is in jruby/joni@118dbde which will not degrade performance from previous versions. Keeping the issue open until we decide on adding unsave and approximate length routines to org.jcodings.Encoding.

  5. added a commit that references this issue on Oct 3, 2018
  6. lopex commented on Oct 3, 2018

    @lopex
    Contributor

    @ahorek joni is released and jruby snaps updated, thanks for the report.

  7. headius commented on Apr 25, 2019

    @headius
    Member

    @lopex Is there a further fix needed here?

  8. lopex commented on Apr 25, 2019

    @lopex
    Contributor

    The ultimate fix would be to implement approximate length for our encodings. For now, as a workaround, Sunday search is turned off for case insensitive forward searches.

  9. lopex commented on Apr 25, 2019

    @lopex
    Contributor

    Closing, created a new issue that explains it here #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions