sangria-http4s-graalvm-example icon indicating copy to clipboard operation
sangria-http4s-graalvm-example copied to clipboard

NPE when running nativeImage

Open joprice opened this issue 6 years ago • 1 comments

I get an NPE with the following stacktrace when trying this:

[info] Detected unnecessary RecomputeFieldValue.ArrayBaseOffset com.oracle.svm.core.jdk.Target_java_nio_DirectByteBuffer.arrayBaseOffset substitution field for java.nio.DirectByteBuffer.arrayBaseOffset. The annotated field can be removed. This ArrayBaseOffset computation can be detected automatically. Use option -H:+UnsafeAutomaticSubstitutionsLogLevel=2 to print all automatically detected substitutions.
[error] warning: unknown locality of class Lfs2/internal/Algebra$R$1;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$R$1; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/internal/Algebra$Done$3;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$Done$3; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/internal/Algebra$Out$3;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$Out$3; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/internal/Algebra$Done$4$;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$Done$4$; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/internal/Algebra$Interrupted$3;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$Interrupted$3; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/internal/Algebra$OpenInterruptibly$3;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$OpenInterruptibly$3; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/async/mutable/Signal$ID$1;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/async/mutable/Signal$ID$1; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/internal/Algebra$Interrupted$4$;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$Interrupted$4$; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/internal/Algebra$Out$4$;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$Out$4$; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/internal/Algebra$OpenInterruptibly$4$;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/internal/Algebra$OpenInterruptibly$4$; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/async/mutable/Queue$State$4$;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/async/mutable/Queue$State$4$; which is not following the naming convention.
[error] warning: unknown locality of class Lfs2/async/mutable/Queue$State$3;, assuming class is not local. To remove the warning report an issue to the library or language author. The issue is caused by Lfs2/async/mutable/Queue$State$3; which is not following the naming convention.
[info]   (typeflow):  82,180.92 ms
[info]    (objects):  43,456.92 ms
[info]   (features):     783.05 ms
[info]     analysis: 141,919.52 ms
[info]     universe:  10,014.44 ms
[info]      (parse):  16,428.37 ms
[info]     (inline):  24,391.06 ms
[info]    (compile):  45,595.95 ms
[info]      compile:  93,259.27 ms
[info]        image:   2,576.69 ms
[error] fatal error: java.lang.NullPointerException
[error] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[error] 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[error] 	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
[error] 	at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1005)
[error] 	at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:414)
[error] 	at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:275)
[error] 	at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:372)
[error] 	at com.oracle.svm.hosted.server.NativeImageBuildServer.executeCompilation(NativeImageBuildServer.java:390)
[error] 	at com.oracle.svm.hosted.server.NativeImageBuildServer.lambda$processCommand$8(NativeImageBuildServer.java:327)
[error] 	at com.oracle.svm.hosted.server.NativeImageBuildServer.withJVMContext(NativeImageBuildServer.java:408)
[error] 	at com.oracle.svm.hosted.server.NativeImageBuildServer.processCommand(NativeImageBuildServer.java:324)
[error] 	at com.oracle.svm.hosted.server.NativeImageBuildServer.processRequest(NativeImageBuildServer.java:268)
[error] 	at com.oracle.svm.hosted.server.NativeImageBuildServer.lambda$serve$7(NativeImageBuildServer.java:228)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)
[error] Caused by: java.lang.NullPointerException
[error] 	at com.oracle.svm.hosted.meta.HostedUniverse.lookup(HostedUniverse.java:158)
[error] 	at com.oracle.svm.hosted.meta.HostedUniverse.lookup(HostedUniverse.java:67)
[error] 	at com.oracle.graal.pointsto.infrastructure.UniverseMetaAccess.lookupJavaField(UniverseMetaAccess.java:104)
[error] 	at com.oracle.svm.hosted.meta.HostedMetaAccess.lookupJavaField(HostedMetaAccess.java:88)
[error] 	at com.oracle.svm.reflect.hosted.FieldOffsetComputer.compute(FieldOffsetComputer.java:46)
[error] 	at com.oracle.svm.hosted.substitute.ComputedValueField.readValue(ComputedValueField.java:246)
[error] 	at com.oracle.svm.core.meta.ReadableJavaField.readFieldValue(ReadableJavaField.java:35)
[error] 	at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.readValue(AnalysisConstantReflectionProvider.java:79)
[error] 	at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.readFieldValue(AnalysisConstantReflectionProvider.java:72)
[error] 	at com.oracle.svm.hosted.meta.HostedField.readValue(HostedField.java:158)
[error] 	at com.oracle.svm.hosted.image.NativeImageHeap.writeField(NativeImageHeap.java:615)
[error] 	at com.oracle.svm.hosted.image.NativeImageHeap.writeObject(NativeImageHeap.java:874)
[error] 	at com.oracle.svm.hosted.image.NativeImageHeap.writeHeap(NativeImageHeap.java:268)
[error] 	at com.oracle.svm.hosted.image.NativeBootImage.build(NativeBootImage.java:419)
[error] 	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:877)
[error] 	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:397)
[error] 	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
[error] 	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
[error] 	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
[error] 	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
[error] 	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

joprice avatar Oct 03 '18 22:10 joprice

It looks like the exception is in SVM (native-image tool). i'm not 100% sure what might have caused it. Maybe it's worth reporting it here https://github.com/oracle/graal/issues ?

OlegIlyenko avatar Oct 06 '18 17:10 OlegIlyenko