graalvm-0.30 native-image NPE on Linux

Leonardo Loch Zanivan pangalz at gmail.com
Tue Dec 12 14:10:55 UTC 2017


Hi Codrut,

You were right, after trying HelloWorld example with the latest build I got
the following error:

$ native-image -verbose HelloWorld
Executing [
/graalvm-0.30.1/jre/bin/java \
-server \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-XX:-UseJVMCIClassLoader \
-XX:+UseJVMCICompiler \
-Dgraal.CompileGraalWithC1Only=false \
-d64 \
-noverify \
-Xbootclasspath/a:/graalvm-0.30.1/jre/lib/boot/graaljs-scriptengine.jar:/graalvm-0.30.1/jre/lib/boot/graal-sdk.jar
\
-cp \
/graalvm-0.30.1/jre/lib/svm/svm.jar:/graalvm-0.30.1/jre/lib/svm/objectfile.jar:/graalvm-0.30.1/jre/lib/svm/pointsto.jar:/graalvm-0.30.1/jre/lib/svm/svm-enterprise.jar:/graalvm-0.30.1/jre/lib/jvmci/jvmci-api.jar:/graalvm-0.30.1/jre/lib/jvmci/jvmci-hotspot.jar:/graalvm-0.30.1/jre/lib/jvmci/enterprise-graal.jar:/graalvm-0.30.1/jre/lib/jvmci/graal.jar
\
-Duser.country=US \
-Duser.language=en \
-Dgraal.EagerSnippets=true \
-Dsubstratevm.version=2b30530bbcf4c190cd9bbdb941b7f2a9fcf66e8e \
-Dgraalvm.version=0.30.1 \
-Dorg.graalvm.version=0.30.1 \
-Xms1G \
-Xss10m \
-Dcom.oracle.graalvm.isaot=true \
com.oracle.svm.hosted.NativeImageGeneratorRunner \
-imagecp \
/graalvm-0.30.1/jre/lib/svm/svm.jar:/graalvm-0.30.1/jre/lib/svm/objectfile.jar:/graalvm-0.30.1/jre/lib/svm/pointsto.jar:/graalvm-0.30.1/jre/lib/svm/svm-enterprise.jar:/graalvm-0.30.1/jre/lib/jvmci/jvmci-api.jar:/graalvm-0.30.1/jre/lib/jvmci/jvmci-hotspot.jar:/graalvm-0.30.1/jre/lib/jvmci/enterprise-graal.jar:/graalvm-0.30.1/jre/lib/jvmci/graal.jar:/graalvm-0.30.1/jre/lib/svm/library-support.jar:/graalvm-0.30.1/examples/native-image
\
-H:Path=. \
-H:InspectServerContentPath=/graalvm-0.30.1/jre/lib/svm/inspect \
-H:CLibraryPath=/graalvm-0.30.1/jre/lib/svm/clibraries/linux-amd64 \
-H:Class=HelloWorld \
-H:Name=helloworld
]
   classlist:   1,719.68 ms
       (cap):     740.90 ms
       setup:     987.63 ms
error: Error compiling query code (in
/tmp/SVM-5871999628125146202/PosixDirectives.c). Compiler command  gcc
/tmp/SVM-5871999628125146202/PosixDirectives.c -o
/tmp/SVM-5871999628125146202/PosixDirectives output included error:
/tmp/SVM-5871999628125146202/PosixDirectives.c:51:18: fatal error: zlib.h:
No such file or directory
    C file contents around line 51:
    /tmp/SVM-5871999628125146202/PosixDirectives.c:50: #include <unistd.h>
    /tmp/SVM-5871999628125146202/PosixDirectives.c:51: #include <zlib.h>
    /tmp/SVM-5871999628125146202/PosixDirectives.c:52: #include
<arpa/inet.h>
Error: Image building with exit status 1


On Tue, Dec 12, 2017 at 2:14 AM Codrut Stancu <codrut.stancu at oracle.com>
wrote:

> Hi Leonardo,
>
> We released a new version (graalvm-0.30.1) that fixes the NPE. The NPE
> was thrown on an exception path and was hiding the real reason for the
> crash that you reported. We were able to determine that from the trace
> that you provided, however, we were not able to reproduce the crash.
> Please download the new binaries and run the examples again. You will
> most likely encounter the exception that was hidden by the NPE and that
> should take us one step closer.
>
> Regards,
> Codrut Stancu
>
> On Tue, 2017-12-05 at 15:33 +0000, Leonardo Loch Zanivan wrote:
> > Hi,
> >
> > native-image not working on my Linux, even with HelloWorld sample.
> >
> > *$ native-image -verbose HelloWorld*
> >
> > Executing [
> > /home/ubuntu/Desktop/graal/graalvm-0.30/jre/bin/java \
> > -server \
> > -XX:+UnlockExperimentalVMOptions \
> > -XX:+EnableJVMCI \
> > -XX:-UseJVMCIClassLoader \
> > -XX:+UseJVMCICompiler \
> > -Dgraal.CompileGraalWithC1Only=false \
> > -d64 \
> > -noverify \
> > -Xbootclasspath/a:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/boot/graaljs-
> > scriptengine.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/boot/graal-sdk.jar
> > \
> > -cp \
> > /home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/svm.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/objectfile.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/pointsto.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/svm-
> > enterprise.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/jvmci/jvmci-api.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/jvmci/jvmci-
> > hotspot.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/jvmci/enterprise-
> > graal.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/jvmci/graal.jar
> > \
> > -Duser.country=US \
> > -Duser.language=en \
> > -Dgraal.EagerSnippets=true \
> > -Dsubstratevm.version=4e7e677ee680676a3285352862d011c324200b57 \
> > -Dgraalvm.version=0.30 \
> > -Dorg.graalvm.version=0.30 \
> > -Xms1G \
> > -Xss10m \
> > -Dcom.oracle.graalvm.isaot=true \
> > com.oracle.svm.hosted.NativeImageGeneratorRunner \
> > -imagecp \
> > /home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/svm.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/objectfile.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/pointsto.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/svm-
> > enterprise.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/jvmci/jvmci-api.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/jvmci/jvmci-
> > hotspot.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/jvmci/enterprise-
> > graal.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/jvmci/graal.jar:/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/library-
> > support.jar:/home/ubuntu/Desktop/graal/graalvm-0.30/examples/native-
> > image
> > \
> > -H:Path=. \
> > -H:InspectServerContentPath=/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/inspect
> > \
> > -H:CLibraryPath=/home/ubuntu/Desktop/graal/graalvm-
> > 0.30/jre/lib/svm/clibraries/linux-amd64
> > \
> > -H:Class=HelloWorld \
> > -H:Name=helloworld
> > ]
> >    classlist:   1,800.75 ms
> >        (cap):     486.01 ms
> >        setup:     826.72 ms
> > fatal error: java.lang.NullPointerException
> > at com.oracle.svm.enterprise.a.i.onAnalysisExit(stripped:23)
> > at
> > com.oracle.svm.hosted.NativeImageGenerator.lambda$doRun$7(NativeImage
> > Generator.java:642)
> > at
> > com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.ja
> > va:39)
> > at
> > com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator
> > .java:642)
> > at
> > com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.j
> > ava:349)
> > at
> > com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeIma
> > geGeneratorRunner.java:221)
> > at
> > com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGen
> > eratorRunner.java:312)
> > at
> > com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGene
> > ratorRunner.java:58)
> > Error: Image building with exit status 1
> >
> > Environment:
> > Ubuntu 16.10 on VirtualBox
> > Linux ubuntu-1 4.8.0-59-generic #64-Ubuntu SMP Thu Jun 29 19:38:34
> > UTC 2017
> > x86_64 x86_64 x86_64 GNU/Linux
>


More information about the graal-dev mailing list