oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.01k stars 184 forks source link

Crash when running fannkuch redux from CLBG #128

Closed vext01 closed 7 years ago

vext01 commented 7 years ago

Using the graal-vm-0.22 tag, with a hand built graal/truffle. The fannkuch redux benchmark crashes as follows:

$ PATH=/home/vext01/warmup_experiment/work/mx:${PATH} JAVA_HOME=/home/vext01/warmup_experiment/work/graal-jvmci-8/jdk1.8.0_121/product GRAAL_HOME=~/warmup_experiment/work/graal /home/vext01/warmup_experiment/work/truffleruby/tool/jt.rb run --graal bench.rb                                                                    
$ JAVACMD=/home/vext01/warmup_experiment/work/graal-jvmci-8/jdk1.8.0_121/product/bin/java /home/vext01/warmup_experiment/work/truffleruby/bin/truffleruby -Xcore.load_path=/home/vext01/warmup_experiment/work/truffleruby/truffleruby/src/main/ruby -J-server -J-XX:+UnlockExperimentalVMOptions -J-XX:+EnableJVMCI -J-d64 -J-Djvmci.class.path.append=/home/vext01/warmup_experiment/work/graal/mxbuild/dists/graal.jar -J-Xbootclasspath/a:/home/vext01/warmup_experiment/work/truffle/mxbuild/dists/truffle-api.jar bench.rb
bench.rb:14:in `inner_iter': internal implementation error - 
NoSuchMethodError com.oracle.truffle.api.nodes.RootNode.<init>(Lcom/oracle/truffle/api/TruffleLanguage;Lcom/oracle/truffle/api/frame/FrameDescriptor;)V org.graalvm.compiler.truffle.OptimizedOSRLoopNode$OSRRootNode.<init>(OptimizedOSRLoopNode.java:407) (RubyTruffleError)
        from bench.rb:10:in `block in run_iter'
        from bench.rb:9:in `each'
        from bench.rb:9:in `run_iter'
        from bench.rb:78:in `<main>'
FAILED (pid 27122 exit 1): JAVACMD=/home/vext01/warmup_experiment/work/graal-jvmci-8/jdk1.8.0_121/product/bin/java /home/vext01/warmup_experiment/work/truffleruby/bin/truffleruby -Xcore.load_path=/home/vext01/warmup_experiment/work/truffleruby/truffleruby/src/main/ruby -J-server -J-XX:+UnlockExperimentalVMOptions -J-XX:+EnableJVMCI -J-d64 -J-Djvmci.class.path.append=/home/vext01/warmup_experiment/work/graal/mxbuild/dists/graal.jar -J-Xbootclasspath/a:/home/vext01/warmup_experiment/work/truffle/mxbuild/dists/truffle-api.jar bench.rb

The benchmark is here: https://github.com/softdevteam/warmup_experiment/blob/master/benchmarks/fannkuch_redux/ruby/bench.rb

Add to the bottom of the file run_iter 200 to make the benchmark executable.

Hoping we can find a patch.

Thanks

chrisseaton commented 7 years ago

Is this with your patch applied?

It looks like the issue may be an incompatible Truffle and Graal version. Can you give me the commits you are using of Truffle, Graal and TruffleRuby? The commits that end up being the current one in practice at the end of your build in each of those repos, rather than those which you intend to use.

They should be:

vext01 commented 7 years ago

Hi Chris,

Yes, this is with our patch, but I don't think it's related to that (I hope).

It seems that, indeed, there are version discrepancies. I have:

Truffle is automatically fetch by mx. So either we have an mx bug, or I'm using it wrong.

Perhaps you could review my build steps and see if I'm doing something wrong. Must admit, I don't really understand mx. Perhaps I can just checkout the right truffle tag once mx fetched it?

Here's how I build a JVMCI enabled JVM: https://github.com/softdevteam/warmup_experiment/blob/update-vms-2017/build.sh#L495

And here's the TruffleRuby part: https://github.com/softdevteam/warmup_experiment/blob/update-vms-2017/build.sh#L578

vext01 commented 7 years ago

If I try forcing the truffle version to graalvm-0.22 (to match the hash you posted above), I get the same error...

I'm not sure I can simply check out a tag like that. I'm probably short-circuiting some stuff mx is supposed to take care of...

chrisseaton commented 7 years ago

We're mixing Maven and mx here. mx doesn't get a chance to specify the Truffle version that Ruby builds with. Try this:

diff --git a/mx.truffleruby/suite.py b/mx.truffleruby/suite.py
index 77f9daf..b782115 100644
--- a/mx.truffleruby/suite.py
+++ b/mx.truffleruby/suite.py
@@ -15,7 +15,7 @@ suite = {
             {
                 "name": "truffle",
                 # Must be the same as in truffle/pom.xml (except for the -SNAPSHOT part only in pom.xml, and there we can use a release name)
-                "version": "c02973969fb144b533ae0e53187674cb04c2aacc",
+                "version": "8ee22e950e033dada680381ed9e02b0225360110",
                 "urls": [
                     {"url": "https://github.com/graalvm/truffle.git", "kind": "git"},
                     {"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
diff --git a/truffleruby/pom.xml b/truffleruby/pom.xml
index bbd7871..7ef82d1 100644
--- a/truffleruby/pom.xml
+++ b/truffleruby/pom.xml
@@ -11,7 +11,7 @@
   <properties>
     <maven.test.skip>true</maven.test.skip>
     <!-- Must be the same as in mx.truffleruby/suite.py (except for the -SNAPSHOT part, and here we can use a release name) -->
-    <truffle.version>c02973969fb144b533ae0e53187674cb04c2aacc-SNAPSHOT</truffle.version>
+    <truffle.version>8ee22e950e033dada680381ed9e02b0225360110-SNAPSHOT</truffle.version>
   </properties>
   <repositories>
     <repository>
vext01 commented 7 years ago

Thanks for your help with this chris.