As mentioned in the discussion following https://github.com/oracle/graal/issues/2234#issuecomment-610938442, the native image JVM agent now produces an entry for org.graalvm.compiler.hotspot.management.SVMToHotSpotEntryPoints in jni-config.json, resulting in the following during the native image build.
[/build/native-image-tests.bin:9963] classlist: 15,245.21 ms, 3.10 GB
[/build/native-image-tests.bin:9963] (cap): 2,510.49 ms, 3.26 GB
[/build/native-image-tests.bin:9963] setup: 5,897.09 ms, 3.26 GB
[/build/native-image-tests.bin:9963] analysis: 6,419.58 ms, 3.26 GB
Error: type is not available in this platform: org.graalvm.compiler.hotspot.management.SVMToHotSpotEntryPoints
com.oracle.svm.core.util.UserError$UserException: type is not available in this platform: org.graalvm.compiler.hotspot.management.SVMToHotSpotEntryPoints
at com.oracle.svm.core.util.UserError.abort(UserError.java:79)
at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:221)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:754)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:538)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:451)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: type is not available in this platform: org.graalvm.compiler.hotspot.management.SVMToHotSpotEntryPoints
at com.oracle.graal.pointsto.meta.AnalysisUniverse.createType(AnalysisUniverse.java:214)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:205)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:182)
at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:75)
at com.oracle.graal.pointsto.infrastructure.UniverseMetaAccess$1.apply(UniverseMetaAccess.java:52)
at com.oracle.graal.pointsto.infrastructure.UniverseMetaAccess$1.apply(UniverseMetaAccess.java:49)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688)
at com.oracle.graal.pointsto.infrastructure.UniverseMetaAccess.lookupJavaType(UniverseMetaAccess.java:84)
at com.oracle.graal.pointsto.meta.AnalysisMetaAccess.lookupJavaType(AnalysisMetaAccess.java:47)
at com.oracle.svm.hosted.substitute.SubstitutionReflectivityFilter.shouldExclude(SubstitutionReflectivityFilter.java:46)
at com.oracle.svm.jni.access.JNIAccessFeature.addClass(JNIAccessFeature.java:243)
at com.oracle.svm.jni.access.JNIAccessFeature.duringAnalysis(JNIAccessFeature.java:222)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$8(NativeImageGenerator.java:721)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:63)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:721)
... 7 more
Error: Image build request failed with exit status 1
I unfortunately do not have a simplified example to reproduce this regression, but I can tell you how I encountered it.
git clone [email protected]:sbrannen/spring-framework.gitgraalvm-testing feature branch from that clone.GraalVM_Testing.md in the root of the repository, but using GraalVM CE 20.1.0-dev-20200411_0336 instead of GraalVM CE 20.0.0.spring-core project. You should be able to reproduce it via the following command../gradlew --no-build-cache -DnativeImageTesting=true :spring-core:clean :spring-core:testInNativeImage
If I run the agent with this project
https://github.com/warrenc5/jain-slee-js.git
mvn -Prun
I get the same error in target/native/jni-config.json
{
"name":"jdk.vm.ci.hotspot.HotSpotJVMCIRuntime",
"methods":[{"name":"runtime","parameterTypes":[] }]
},
Otherwise I remove that above from the auto generated jni-config and can build OK!
This error can be reproduced with our commandlinerunner sample from spring-graal-native:
git clone https://github.com/spring-projects-experimental/spring-graal-native.git./build.shcd spring-graal-native-samples/commandlinerunner/agent./build.shThanks, I'm also seeing more issues like this one with the fix for #2334/#2335, so I hope I can fix this long-term with a filter.
Looks like this might be fixed by #2322 -- yes?
Ah, I missed that one. Nevertheless, I already have a more comprehensive fix that replaces these case-by-case filters with a broader filter for classes of Libgraal and JVMCI when no caller frame is available.
Great news thanks :-)
Fixed with 9abecf764253a023c69882ca543848e3b4c9125e.
Most helpful comment
This error can be reproduced with our
commandlinerunnersample fromspring-graal-native:git clone https://github.com/spring-projects-experimental/spring-graal-native.git./build.shcd spring-graal-native-samples/commandlinerunner/agent./build.sh