Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre1
    • Fix Version/s: JRuby 1.7.0.pre2
    • Labels:
      None
    • Environment:
    • Number of attachments :
      0

      Description

      [ctusa@archbox project1]$ jgem search -r akers
      
      [ctusa@archbox project1]$ jgem search -r ak
      
      *** REMOTE GEMS ***
      
      ByteCodeMachine.java:561:in `opExactMB3N': java.lang.ArrayIndexOutOfBoundsException: 13
      	from ByteCodeMachine.java:205:in `matchAt'
      	from Matcher.java:293:in `matchCheck'
      	from Matcher.java:438:in `search'
      	from RubyRegexp.java:1620:in `search19'
      	from RubyRegexp.java:1459:in `eqq19'
      	from RubyRegexp$INVOKER$i$1$0$eqq19.gen:-1:in `call'
      	from CachingCallSite.java:167:in `call'
      	from CallOneArgNode.java:57:in `interpret'
      	from IfNode.java:110:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:233:in `call'
      	from DefaultMethod.java:218:in `call'
      	from CachingCallSite.java:201:in `call'
      	from CallTwoArgNode.java:59:in `interpret'
      	from IfNode.java:110:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from ASTInterpreter.java:112:in `INTERPRET_BLOCK'
      	from Interpreted19Block.java:209:in `evalBlockBody'
      	from Interpreted19Block.java:160:in `yield'
      	from Block.java:130:in `yield'
      	from RubyArray.java:2397:in `selectCommon'
      	from RubyArray.java:2406:in `select'
      	from RubyArray$INVOKER$i$0$0$select.gen:-1:in `call'
      	from CachingCallSite.java:302:in `cacheAndCall'
      	from CachingCallSite.java:144:in `callBlock'
      	from CachingCallSite.java:153:in `callIter'
      	from CallNoArgBlockNode.java:64:in `interpret'
      	from AttrAssignTwoArgNode.java:36:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from ASTInterpreter.java:112:in `INTERPRET_BLOCK'
      	from Interpreted19Block.java:209:in `evalBlockBody'
      	from Interpreted19Block.java:160:in `yield'
      	from Block.java:130:in `yield'
      	from RubyHash.java:1207:in `visit'
      	from RubyHash.java:594:in `visitAll'
      	from RubyHash.java:1158:in `iteratorVisitAll'
      	from RubyHash.java:1203:in `each_pairCommon'
      	from RubyHash.java:1194:in `each19'
      	from RubyHash$INVOKER$i$0$0$each19.gen:-1:in `call'
      	from CachingCallSite.java:302:in `cacheAndCall'
      	from CachingCallSite.java:144:in `callBlock'
      	from CachingCallSite.java:153:in `callIter'
      	from CallNoArgBlockNode.java:64:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:120:in `call'
      	from InterpretedMethod.java:134:in `call'
      	from DefaultMethod.java:174:in `call'
      	from AliasMethod.java:76:in `call'
      	from CachingCallSite.java:282:in `cacheAndCall'
      	from CachingCallSite.java:71:in `call'
      	from FCallManyArgsNode.java:60:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from IfNode.java:118:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:120:in `call'
      	from InterpretedMethod.java:134:in `call'
      	from DefaultMethod.java:174:in `call'
      	from CachingCallSite.java:282:in `cacheAndCall'
      	from CachingCallSite.java:71:in `call'
      	from FCallSpecialArgNode.java:45:in `interpret'
      	from CallNoArgNode.java:63:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:120:in `call'
      	from InterpretedMethod.java:134:in `call'
      	from DefaultMethod.java:174:in `call'
      	from CachingCallSite.java:282:in `cacheAndCall'
      	from CachingCallSite.java:71:in `call'
      	from CallManyArgsNode.java:59:in `interpret'
      	from LocalAsgnNode.java:123:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from IfNode.java:116:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:169:in `call'
      	from DefaultMethod.java:191:in `call'
      	from SuperCallSite.java:346:in `cacheAndCall'
      	from SuperCallSite.java:146:in `callBlock'
      	from SuperCallSite.java:151:in `call'
      	from SuperCallSite.java:107:in `callVarargs'
      	from ZSuperNode.java:102:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:147:in `call'
      	from DefaultMethod.java:183:in `call'
      	from CachingCallSite.java:292:in `cacheAndCall'
      	from CachingCallSite.java:135:in `call'
      	from VCallNode.java:86:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from IfNode.java:118:in `interpret'
      	from IfNode.java:118:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:233:in `call'
      	from DefaultMethod.java:215:in `call'
      	from CachingCallSite.java:332:in `cacheAndCall'
      	from CachingCallSite.java:203:in `call'
      	from CallSpecialArgNode.java:69:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from CaseNode.java:137:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:190:in `call'
      	from DefaultMethod.java:199:in `call'
      	from CachingCallSite.java:312:in `cacheAndCall'
      	from CachingCallSite.java:169:in `call'
      	from FCallOneArgNode.java:36:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from RescueNode.java:226:in `executeBody'
      	from RescueNode.java:123:in `interpretWithJavaExceptions'
      	from RescueNode.java:113:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:190:in `call'
      	from DefaultMethod.java:199:in `call'
      	from CachingCallSite.java:312:in `cacheAndCall'
      	from CachingCallSite.java:169:in `call'
      	from CallOneArgNode.java:57:in `interpret'
      	from NewlineNode.java:104:in `interpret'
      	from BlockNode.java:71:in `interpret'
      	from ASTInterpreter.java:75:in `INTERPRET_METHOD'
      	from InterpretedMethod.java:190:in `call'
      	from DefaultMethod.java:199:in `call'
      	from MethodHandle.java:566:in `invokeWithArguments'
      	from InvocationLinker.java:166:in `invocationFallback'
      	from /opt/dstick/devel/jruby/bin/jgem:21:in `chained_0_rescue_1$RUBY$SYNTHETIC__file__'
      	from /opt/dstick/devel/jruby/bin/jgem:20:in `__file__'
      	from /opt/dstick/devel/jruby/bin/jgem:-1:in `load'
      	from Ruby.java:778:in `runScript'
      	from Ruby.java:771:in `runScript'
      	from Ruby.java:648:in `runNormally'
      	from Ruby.java:497:in `runFromMain'
      	from Main.java:375:in `doRunFromMain'
      	from Main.java:264:in `internalRun'
      	from Main.java:230:in `run'
      	from Main.java:214:in `run'
      	from Main.java:194:in `main'
      

        Activity

        Hide
        Chris Tusa added a comment -

        Gem installation works as expected. 'jgem install aker'

        Show
        Chris Tusa added a comment - Gem installation works as expected. 'jgem install aker'
        Hide
        Andy Lindeman added a comment -

        I was able to get this simpler case to demonstrate the same error:

        1.9.3p194 :013 >   /(?i-mx:ak)/ === "access_schema".force_encoding("UTF-8")
        java.lang.ArrayIndexOutOfBoundsException: 13
                at org.joni.ByteCodeMachine.opExactMB3N(ByteCodeMachine.java:561)
                at org.joni.ByteCodeMachine.matchAt(ByteCodeMachine.java:205)
        

        Notably, it doesn't occur with this:

        1.9.3p194 :018 > /(?i-mx:ak)/ === "access_schema"
         => false
        

        Or this:

        1.9.3p194 :019 > /(?i-mx:ak)/ === "access_schema".force_encoding("US-ASCII")
         => false
        
        Show
        Andy Lindeman added a comment - I was able to get this simpler case to demonstrate the same error: 1.9.3p194 :013 > /(?i-mx:ak)/ === "access_schema" .force_encoding( "UTF-8" ) java.lang.ArrayIndexOutOfBoundsException: 13 at org.joni.ByteCodeMachine.opExactMB3N(ByteCodeMachine.java:561) at org.joni.ByteCodeMachine.matchAt(ByteCodeMachine.java:205) Notably, it doesn't occur with this: 1.9.3p194 :018 > /(?i-mx:ak)/ === "access_schema" => false Or this: 1.9.3p194 :019 > /(?i-mx:ak)/ === "access_schema" .force_encoding( "US-ASCII" ) => false
        Hide
        Andy Lindeman added a comment -

        I don't really know how to take debugging much further. Not familiar with the internals of joni :/

        Show
        Andy Lindeman added a comment - I don't really know how to take debugging much further. Not familiar with the internals of joni :/
        Hide
        Charles Oliver Nutter added a comment -

        Andy: The reduced version is very helpful, thanks. I have reproduced locally.

        Show
        Charles Oliver Nutter added a comment - Andy: The reduced version is very helpful, thanks. I have reproduced locally.
        Hide
        Charles Oliver Nutter added a comment -

        The version with .encode instead of .force_encoding works too:

        irb(main):003:0* /(?i-mx:ak)/ === "access_schema".encode("UTF-8")
        => false
        
        Show
        Charles Oliver Nutter added a comment - The version with .encode instead of .force_encoding works too: irb(main):003:0* /(?i-mx:ak)/ === "access_schema" .encode( "UTF-8" ) => false
        Hide
        Marcin Miel?y?ski added a comment -

        Fixed in a5977328faadce9d308d5f78138d34a961183d0f

        Show
        Marcin Miel?y?ski added a comment - Fixed in a5977328faadce9d308d5f78138d34a961183d0f

          People

          • Assignee:
            Marcin Miel?y?ski
            Reporter:
            Chris Tusa
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: