You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GraalVM version or commit id if built from source: [21.3.1]
CE or EE: [CE]
JDK version: [JDK8]
OS and OS Version: [Linux Ubunti 22.04]
Architecture: [amd64]
The output of java -Xinternalversion:
**OpenJDK 64-Bit Server VM GraalVM CE 21.3.1 (25.302-b06-jvmci-21.3-b05) for linux-amd64 JRE (1.8.0), built on Oct 16 2021 10:47:15 by "buildslave" with gcc 7.3.0**
Describe the issue
Hello,
I'm using ScriptEngine API to call some JS scripts in my application.
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine jsEngine = sem.getEngineByName("graal.js");
.....
jsEngine.eval(mathFunctionScript)
In normal execution it's fine. Trying to package it as a native-image app I got NullPointerException when trying to call the eval method on the ScriptEngine instance at the runtime.
After investigating some related issues here, I added --language:js to the build properties and then I got the below exceptions:
[app:7434] classlist: 16,051.19 ms, 1.79 GB
[app:7434] (cap): 1,107.08 ms, 2.37 GB
[app:7434] setup: 6,493.77 ms, 2.37 GB
[app:7434] analysis: 204,468.56 ms, 5.49 GB
Fatal error:com.oracle.svm.core.util.VMError$HostedError: types reachable for JIT compilation must not have linkage errors
at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:68)
at com.oracle.svm.core.util.VMError.guarantee(VMError.java:89)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.createType(GraalObjectReplacer.java:290)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.createField(GraalObjectReplacer.java:248)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.createAllInstanceFields(GraalObjectReplacer.java:325)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.createType(GraalObjectReplacer.java:301)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.createField(GraalObjectReplacer.java:248)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.createAllInstanceFields(GraalObjectReplacer.java:325)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.createType(GraalObjectReplacer.java:301)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.createMethod(GraalObjectReplacer.java:214)
at com.oracle.svm.graal.hosted.GraalObjectReplacer.updateDataDuringAnalysis(GraalObjectReplacer.java:369)
at com.oracle.svm.graal.hosted.GraalFeature.duringAnalysis(GraalFeature.java:508)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$12(NativeImageGenerator.java:727)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:73)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:727)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:529)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:488)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:569)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:122)
[app:7434] [total]: 229,493.38 ms, 5.49 GB
Here is the list of the flags I'm using for building the image:
The prerequisite packages are installed sudo apt-get install build-essential libz-dev zlib1g-dev
Update1
Exact same exception with GraalVM version CE 22.1.0 JDK 11:
[1/7] Initializing... (16.0s @ 0.36GB)
Version info: 'GraalVM 22.1.0 Java 11 CE'
C compiler: gcc (linux, x86_64, 11.2.0)
Garbage collector: Serial GC
1 user-provided feature(s)
- com.oracle.svm.thirdparty.gson.GsonFeature
Update2
I found out that having below dependency is causing the exception. Removing it I get no exception at the build time and both building and execution are fine with --language:js flag.
@oubidar-Abderrahim Maybe we're better to use native-image label rather than truffle
Do you have the right to change the label? Hopefully, it'll attract more attention.
Describe GraalVM and your environment :
java -Xinternalversion
:Describe the issue
Hello,
I'm using
ScriptEngine
API to call some JS scripts in my application.In normal execution it's fine. Trying to package it as a native-image app I got
NullPointerException
when trying to call theeval
method on theScriptEngine
instance at the runtime.After investigating some related issues here, I added
--language:js
to the build properties and then I got the below exceptions:Here is the list of the flags I'm using for building the image:
Finally the version of the related dependencies:
The prerequisite packages are installed
sudo apt-get install build-essential libz-dev zlib1g-dev
Update1
Exact same exception with GraalVM version CE
22.1.0
JDK 11:Update2
I found out that having below dependency is causing the exception. Removing it I get no exception at the build time and both building and execution are fine with
--language:js
flag.Here is a repos to reproduce the exception:
https://github.com/ahoora08/graalvm-js
The text was updated successfully, but these errors were encountered: