Graal: Runtime error using embedded JIT-less languages

Created on 6 May 2020  Â·  5Comments  Â·  Source: oracle/graal

Using GraalVM master, building native-image Hello World with embedded JIT-less languages (-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime -Dgraalvm.ForcePolyglotInvalid=false) would produce runtime error:

Fatal error: Unknown node class: com.oracle.truffle.api.impl.DefaultDirectCallNode

We know that it worked on 5970ec82a2e4f2d9810ff1c88f412b45da551901 but I'm uncertain whether internal API changed, or if this was regression.

Reproducer:

javac Main.java
native-image Main -Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime -Dgraalvm.ForcePolyglotInvalid=false --language:js
./main

Main.java
```java
import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Value;
​
public class Main{
public static void main(String[] args) {
Context polyglot = Context.create("js");
Value array = polyglot.eval("js", "['Hello from js!!!']");
String polyglotResponse = array.getArrayElement(0).asString();
System.out.println(polyglotResponse);
}
}
````
Crash log:
runtime_crash_log.txt

Most helpful comment

@lazar-mitrovic this is the result of merging https://github.com/oracle/graal/pull/2415
Specifically: https://github.com/oracle/graal/commit/691923f6188ce0c5d6a9233024e4208fe7d8fbab

Adding -cp truffle-api.jar to the native-image command should give you a working image build.

All 5 comments

@lazar-mitrovic this is the result of merging https://github.com/oracle/graal/pull/2415
Specifically: https://github.com/oracle/graal/commit/691923f6188ce0c5d6a9233024e4208fe7d8fbab

Adding -cp truffle-api.jar to the native-image command should give you a working image build.

@lazar-mitrovic is using -Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime a common usecase. If it is, I have to come up with something better than https://github.com/oracle/graal/commit/691923f6188ce0c5d6a9233024e4208fe7d8fbab

It is, we should check for both of them.

Was this page helpful?
0 / 5 - 0 ratings