Forum: JRuby java.lang.ArrayIndexOutOfBoundsException sighting

Posted by Jon Forums (jonm)
on 2010-08-08 03:40
(Received via mailing list)
Curiousity got the best of me and I wanted to see how other Ruby impls 
would behave when used to build MRI 1.9.2dev for Windows using our 
latest recipes on 
http://github.com/oneclick/rubyinstaller/tree/use-devkit

After successfully getting through much of the build process, I received 
the above mentioned exception in what appears to be fairly fundamental 
JRuby classes.

If you need to replicate, let me know and I'll reply with the patch I'm 
using to the above branch and my configuration details while attempting 
to build on Win7 Ultimate 32-bit using jruby 1.5.1 (ruby 1.8.7 
patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) Client VM 
1.6.0_21) [x86-java]

Jon


...
gcc -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses 
-Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializers -Wno-long-long -I. 
-I.ext/include/i386-mingw32
-I../../../ruby_1_9_2/include -I../../../ruby_1_9_2 -DRUBY_EXPORT   -o 
variable.o
-c ../../../ruby_1_9_2/variable.c
jruby.exe -Ks ../../../ruby_1_9_2/tool/insns2vm.rb 
--srcdir="../../../ruby_1_9_2" insns.inc
BaseSJISEncoding.java:47:in `codeToMbcLength': 
java.lang.ArrayIndexOutOfBoundsException: -1
        from RubyYaccLexer.java:466:in `isMultiByteChar'
        from RubyYaccLexer.java:456:in `isIdentifierChar'
        from RubyYaccLexer.java:1062:in `getIdentifier'
        from RubyYaccLexer.java:1429:in `identifier'
        from RubyYaccLexer.java:1031:in `yylex'
        from RubyYaccLexer.java:293:in `advance'
        from DefaultRubyParser.java:1380:in `yyparse'
        from DefaultRubyParser.java:1332:in `yyparse'
        from DefaultRubyParser.java:3986:in `parse'
        from Parser.java:111:in `parse'
        from Parser.java:82:in `parse'
        from Parser.java:74:in `parse'
        from Ruby.java:2290:in `parseEval'
        from ASTInterpreter.java:96:in `evalWithBinding'
        from RubyKernel.java:1045:in `eval'
        from 
org/jruby/RubyKernel$s_method_0_3$RUBYFRAMEDINVOKER$eval.gen:65535:in 
`call'
        from DynamicMethod.java:160:in `call'
        from CachingCallSite.java:279:in `cacheAndCall'
        from CachingCallSite.java:68:in `call'
        from FCallManyArgsNode.java:60:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from IfNode.java:119:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from InterpretedMethod.java:180:in `call'
        from DefaultMethod.java:172:in `call'
        from CachingCallSite.java:309:in `cacheAndCall'
        from CachingCallSite.java:148:in `call'
        from CallOneArgNode.java:57:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:139:in `call'
        from DefaultMethod.java:156:in `call'
        from CachingCallSite.java:289:in `cacheAndCall'
        from CachingCallSite.java:108:in `call'
        from CallNoArgNode.java:61:in `interpret'
        from DAsgnNode.java:110:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedBlock.java:373:in `evalBlockBody'
        from InterpretedBlock.java:346:in `yield'
        from InterpretedBlock.java:303:in `yield'
        from Block.java:194:in `yield'
        from RubyArray.java:1630:in `eachCommon'
        from RubyArray.java:1637:in `each'
        from 
org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen:65535:in 
`call'
        from CachingCallSite.java:299:in `cacheAndCall'
        from CachingCallSite.java:117:in `callBlock'
        from CachingCallSite.java:122:in `call'
        from CallNoArgBlockNode.java:64:in `interpret'
        from NewlineNode.java:104:in `interpret'
        from BlockNode.java:71:in `interpret'
        from InterpretedMethod.java:180:in `call'
        from DefaultMethod.java:172:in `call'
        from CachingCallSite.java:309:in `cacheAndCall'
        from CachingCallSite.java:148:in `call'
        from insns2vm.rb:14:in `__file__'
        from insns2vm.rb:-1:in `load'
        from Ruby.java:685:in `runScript'
        from Ruby.java:568:in `runNormally'
        from Ruby.java:414:in `runFromMain'
        from Main.java:286:in `run'
        from Main.java:128:in `run'
        from Main.java:97:in `main'
make: *** [insns.inc] Error 1
rake aborted!
Command failed with status (2): [make...]

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Charles Nutter (headius)
on 2010-08-12 20:53
(Received via mailing list)
Looks like this is a bug in our Shift-JIS encoding support, which
isn't surprising at all. You should go ahead and file a bug or provide
instructions to reproduce this. I'm not sure when we'll get to fixing
it, but we should have the bug filed.

- Charlie

On Sat, Aug 7, 2010 at 8:40 PM, Jon <jon.forums@gmail.com> wrote:
> gcc -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings
>        from RubyYaccLexer.java:293:in `advance'
>        from DynamicMethod.java:160:in `call'
>        from CallOneArgNode.java:57:in `interpret'
>        from InterpretedBlock.java:373:in `evalBlockBody'
>        from NewlineNode.java:104:in `interpret'
>        from Main.java:286:in `run'
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Jon Forums (jonm)
on 2010-08-18 21:59
(Received via mailing list)
> Looks like this is a bug in our Shift-JIS encoding support, which
> isn't surprising at all. You should go ahead and file a bug or provide
> instructions to reproduce this. I'm not sure when we'll get to fixing
> it, but we should have the bug filed.
> 
> - Charlie

While I can't reproduce it with ruby-1.9.2-rc2, I can with the current 
ruby_1_9_2 branch (29039) using the steps below.  Since I can't 
reproduce on both versions I'll hold off filing a bug report unless you 
want it filed.

Jon


# put ruby src in C:\Users\Jon\Documents\ruby_1_9_2
cd C:\Users\Jon\Documents
svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_2

# build RubyInstaller using gcc 4.5.0 and JRuby 1.5.1
git clone git://github.com/oneclick/rubyinstaller.git
cd rubyinstaller
git checkout -b use-devkit origin/use-devkit
git apply 0001-build-with-jruby.patch   # :patch => 
http://gist.github.com/535786
# confirm JRuby 1.5.1 is the only Ruby on PATH
rake ruby19 local="C:\Users\Jon\Documents\ruby_1_9_2"
# wait while everything is downloaded and built
# BOOM

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.