Graal: Regression: native image agent adds SVMToHotSpotEntryPoints to jni-config.json

Created on 13 Apr 2020  路  7Comments  路  Source: oracle/graal

Overview

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.

  1. git clone [email protected]:sbrannen/spring-framework.git
  2. Check out the graalvm-testing feature branch from that clone.
  3. Follow the instructions in the 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.
  4. Specifically, the issue occurs when executing the native image build for tests in the 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

Environment

  • GraalVM version: GraalVM CE 20.1.0-dev-20200411_0336
  • JDK major version: 8
  • OS: macOS 10.14.6
  • Architecture: i386 / x86_64
agent bug native-image spring

Most helpful comment

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.sh
  • cd spring-graal-native-samples/commandlinerunner/agent
  • ./build.sh

All 7 comments

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.sh
  • cd spring-graal-native-samples/commandlinerunner/agent
  • ./build.sh

Thanks, 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

igor-ramazanov picture igor-ramazanov  路  3Comments

schneidersteve picture schneidersteve  路  3Comments

borkdude picture borkdude  路  3Comments

jinwuxia picture jinwuxia  路  3Comments

sebthom picture sebthom  路  3Comments