Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Running helloworld.rb using JRuby on JatoVM: java.lang.ArrayIndexOutOfBoundsException: 32 > 31 #35

Open
SDkie opened this issue Jul 13, 2013 · 18 comments

Comments

@SDkie
Copy link

SDkie commented Jul 13, 2013

Using
Ubuntu 12.04x86
jruby 1.5.6
Jato VM version 0.3

root@sdkie:/home/sdkie/Desktop/programs# jruby hello.rb
Sha256.java:215:in sha': java.lang.ArrayIndexOutOfBoundsException: 32 > 31 from Sha256.java:129:intransform'
from BaseHash.java:123:in update' from Fortuna.java:286:inaddRandomBytes'
from BasePRNG.java:142:in addRandomBytes' from Fortuna.java:309:insetup'
from BasePRNG.java:82:in init' from Fortuna.java:127:insetup'
from BasePRNG.java:82:in init' from FortunaImpl.java:67:inengineSetSeed'
from SecureRandom.java:323:in setSeed' from SecureRandom.java:365:innextBytes'
from SecureRandom.java:386:in next' from Random.java:320:innextLong'
from Ruby.java:208:in <init>' from Ruby.java:275:innewInstance'
from Main.java:262:in internalRun' from Main.java:221:inrun'
from Main.java:201:in `main'

@penberg
Copy link
Member

penberg commented Jul 14, 2013

I'm seeing this with Jato's master:

penberg@titan:~/jruby$ jato -jar lib/jruby.jar -e "puts 'hello'"
hello

Are you using the 0.3 release? If so, can you please try with latest master? If master is broken, please include hello.rb here and I'll see if I can reproduce.

@SDkie
Copy link
Author

SDkie commented Jul 15, 2013

yes.

root@sdkie:/home/sdkie/# jato -version
java version "1.6.0"
Jato VM version 0.3

should I get latest master from:
git clone git://git.kernel.org/pub/scm/java/jato/jato.git
or
git clone https://github.com/jatovm/jato.git

Actually I tried from both, both giving me same issue.

@penberg
Copy link
Member

penberg commented Jul 15, 2013

@SDkie Development happens on Github, I'm just mirroring on git.kernel.org.

Can you please share hello.rb so that I can also try to reproduce?

@SDkie
Copy link
Author

SDkie commented Jul 15, 2013

@penberg

root@sdkie:/home/sdkie/Desktop/programs# cat hello.rb
puts "Hello World"

@penberg
Copy link
Member

penberg commented Jul 16, 2013

@SDkie OK, I'm still not able to reproduce. What GCC version are you using?

@SDkie
Copy link
Author

SDkie commented Jul 16, 2013

@penberg
root@sdkie:/home/sdkie# gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

@penberg
Copy link
Member

penberg commented Jul 16, 2013

@SDkie Oh, this is on x86-64? I've been trying to reproduce on 32-bit. The 64-bit architecture is still known to be broken. See #36, for example, which I'm debugging right now. Once I that's fixed, I'll see if I can get JRuby working also.

@SDkie
Copy link
Author

SDkie commented Jul 19, 2013

@penberg I am working on a project to port JRuby on Embedded systems. JRuby converts Ruby code to bytecode which is executed by any JVM. For this project I am testing performance of JRuby with various available JVMs. I have chosen ARM architecture.
Does currently jato support ARM architecture?

@penberg
Copy link
Member

penberg commented Jul 19, 2013

@SDkie No, not really. There's some ARM specific code in the tree but it's not very useful.

@SDkie
Copy link
Author

SDkie commented Jul 21, 2013

@penberg I can help you reproduce this error when you will be working on this issue.

@penberg
Copy link
Member

penberg commented Nov 9, 2013

@SDkie I finally managed to track down and fix #36. If you have time, can you please retest JRuby and report back if it works or not?

@SDkie
Copy link
Author

SDkie commented Nov 9, 2013

@penberg : Great 👍 I will test it in within next 2 days.

@penberg
Copy link
Member

penberg commented Nov 9, 2013

@SDkie, thanks!

@SDkie
Copy link
Author

SDkie commented Nov 12, 2013

@penberg : tested it on
OS: Linux komal 3.5.0-26-generic #42~precise1-Ubuntu SMP Mon Mar 11 22:17:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Latest JRuby version: jruby 9000.dev (2.1.0.dev) 2013-11-13 f84e398 on jato 1.6.0 [linux-x86-64]

but no success :(

same ERROR:
Sha256.java:215:in sha': java.lang.ArrayIndexOutOfBoundsException: 32 > 31 from Sha256.java:129:intransform'
from BaseHash.java:123:in update' from Fortuna.java:286:inaddRandomBytes'
from BasePRNG.java:142:in addRandomBytes' from Fortuna.java:309:insetup'
from BasePRNG.java:82:in init' from Fortuna.java:127:insetup'
from BasePRNG.java:82:in init' from FortunaImpl.java:67:inengineSetSeed'
from SecureRandom.java:323:in setSeed' from SecureRandom.java:365:innextBytes'
from SecureRandom.java:386:in next' from Random.java:320:innextLong'
from Ruby.java:209:in <init>' from Ruby.java:274:innewInstance'
from Main.java:258:in internalRun' from Main.java:217:inrun'
from Main.java:197:in `main'

@penberg
Copy link
Member

penberg commented Nov 12, 2013

@SDkie Thanks for testing - I'll look into it!

@penberg
Copy link
Member

penberg commented Nov 12, 2013

@SDkie Btw, does make check pass on your machine?

@SDkie
Copy link
Author

SDkie commented Nov 12, 2013

Here are the last few lines of make check:

Annotation processing got disabled, since it requires a 1.6 compliant JVM
REGRESSION
100% [88/88] corrupt.CorruptedMaxLocalVar
88 tests passed, 1 tests skipped (26.34 s)

@penberg
Copy link
Member

penberg commented Nov 12, 2013

@SDkie Interesting - all the tests pass. I'll look into what's wrong with JRuby!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants