Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8191320

Can't run JVMCI compiler with security manager on

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Environment:

      Ubuntu 17.10

    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux_ubuntu

      Description

      Hi.
      I am using JDK10 revision 9d8b720454c6 and when I execute the JVM with JAR coming from https://github.com/jtulach/sieve/tree/master/java/algorithm sources, the execution fails in initializing the JVMCI compiler.

      I did a clean build of the JDK and I hope I build everything correctly. The problem doesn't seem to go away and I hope others will be able to reproduce it as well.

      {code}
      jdk10.internal/jdk10hs$ hg id
      9d8b720454c6 tip


      jdk10.internal/jdk10hs$ ./build/linux-x64/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler -Djava.security.manager -Djava.security.debug=access:domain:failure -jar ~/NetBeansProjects/sieve/java/algorithm/target/sieve-algorithm-1.0-SNAPSHOT.jar
      Computed 97 primes in 0 ms. Last one is 509
      Computed 194 primes in 0 ms. Last one is 1181
      Computed 388 primes in 0 ms. Last one is 2677
      Computed 776 primes in 1 ms. Last one is 5897
      Computed 1552 primes in 1 ms. Last one is 13033
      Computed 3104 primes in 2 ms. Last one is 28541
      Computed 6208 primes in 5 ms. Last one is 61687
      Computed 12416 primes in 12 ms. Last one is 133033
      access: domain (context is null)
      access: access allowed ("java.io.FilePermission" "/home/devel/NetBeansProjects/jdk10.internal/jdk10hs/build/linux-x64/jdk/modules/jdk.internal.vm.compiler" "read")
      access: domain (context is null)
      access: access allowed ("java.io.FilePermission" "/home/devel/NetBeansProjects/jdk10.internal/jdk10hs/build/linux-x64/jdk/modules/jdk.internal.vm.compiler" "read")
      access: domain (context is null)
      access: access allowed ("java.io.FilePermission" "/home/devel/NetBeansProjects/jdk10.internal/jdk10hs/build/linux-x64/jdk/modules/jdk.internal.vm.compiler" "read")
      access: domain (context is null)
      access: access allowed ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")
      Computed 24832 primes in 32 ms. Last one is 284831
      access: access denied ("java.lang.RuntimePermission" "accessClassInPackage.jdk.vm.ci.services")
      java.lang.Exception: Stack trace
              at java.base/java.lang.Thread.dumpStack(Thread.java:1435)
              at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:462)
              at java.base/java.security.AccessController.checkPermission(AccessController.java:895)
              at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:558)
              at java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1534)
              at java.base/java.lang.ClassLoader$1.run(ClassLoader.java:680)
              at java.base/java.lang.ClassLoader$1.run(ClassLoader.java:678)
              at java.base/java.security.AccessController.doPrivileged(Native Method)
              at java.base/java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:678)
              at java.base/java.lang.ClassLoader.defineClass1(Native Method)
              at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1006)
              at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1085)
              at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:206)
              at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:760)
              at java.base/jdk.internal.loader.BuiltinClassLoader.lambda$findClassInModuleOrNull$2(BuiltinClassLoader.java:683)
              at java.base/java.security.AccessController.doPrivileged(Native Method)
              at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:684)
              at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:562)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:607)
              at java.base/java.lang.Class.forName(Class.java:451)
              at java.base/java.util.ServiceLoader.lambda$loadProvider$1(ServiceLoader.java:856)
              at java.base/java.security.AccessController.doPrivileged(Native Method)
              at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:858)
              at java.base/java.util.ServiceLoader.access$600(ServiceLoader.java:390)
              at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1076)
              at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
              at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
              at jdk.internal.vm.ci/jdk.vm.ci.services.JVMCIServiceLocator.getProviders(JVMCIServiceLocator.java:87)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCICompilerConfig.getCompilerFactory(HotSpotJVMCICompilerConfig.java:90)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.<init>(HotSpotJVMCIRuntime.java:290)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.<init>(HotSpotJVMCIRuntime.java:65)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime$DelayedInit.<clinit>(HotSpotJVMCIRuntime.java:73)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime(HotSpotJVMCIRuntime.java:83)
              at jdk.internal.vm.ci/jdk.vm.ci.runtime.JVMCI.initializeRuntime(Native Method)
              at jdk.internal.vm.ci/jdk.vm.ci.runtime.JVMCI.<clinit>(JVMCI.java:58)
      access: domain (context is null)
      access: access allowed ("java.io.FilePermission" "/home/devel/NetBeansProjects/jdk10.internal/jdk10hs/build/linux-x64/jdk/modules/jdk.internal.vm.compiler" "read")
      access: domain that failed ProtectionDomain (file:/home/devel/NetBeansProjects/jdk10.internal/jdk10hs/build/linux-x64/jdk/modules/jdk.internal.vm.compiler/ <no signer certificates>)
       jdk.internal.loader.ClassLoaders$PlatformClassLoader@3d9a2a27
       <no principals>
       java.security.Permissions@1494450f (
       ("java.util.PropertyPermission" "java.specification.version" "read")
       ("java.util.PropertyPermission" "java.vm.vendor" "read")
       ("java.util.PropertyPermission" "path.separator" "read")
       ("java.util.PropertyPermission" "os.version" "read")
       ("java.util.PropertyPermission" "java.vendor.url" "read")
       ("java.util.PropertyPermission" "java.vm.name" "read")
       ("java.util.PropertyPermission" "java.vm.specification.version" "read")
       ("java.util.PropertyPermission" "os.name" "read")
       ("java.util.PropertyPermission" "java.version" "read")
       ("java.util.PropertyPermission" "os.arch" "read")
       ("java.util.PropertyPermission" "java.specification.vendor" "read")
       ("java.util.PropertyPermission" "java.vm.specification.name" "read")
       ("java.util.PropertyPermission" "file.separator" "read")
       ("java.util.PropertyPermission" "line.separator" "read")
       ("java.util.PropertyPermission" "java.vm.specification.vendor" "read")
       ("java.util.PropertyPermission" "java.specification.name" "read")
       ("java.util.PropertyPermission" "java.vendor" "read")
       ("java.util.PropertyPermission" "java.vm.version" "read")
       ("java.util.PropertyPermission" "java.class.version" "read")
       ("java.io.FilePermission" "/home/devel/NetBeansProjects/jdk10.internal/jdk10hs/build/linux-x64/jdk/modules/jdk.internal.vm.compiler/-#plus" "read")
       ("java.io.FilePermission" "/home/devel/NetBeansProjects/jdk10.internal/jdk10hs/build/linux-x64/jdk/modules/jdk.internal.vm.compiler/-" "read")
       ("java.lang.RuntimePermission" "accessClassInPackage.com.apple.*")
       ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.beans.*")
       ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.java.swing.plaf.*")
       ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.beans")
       ("java.net.SocketPermission" "localhost:0" "listen,resolve")
      )


      Uncaught exception at /home/devel/NetBeansProjects/jdk10.internal/jdk10hs/open/src/hotspot/share/jvmci/jvmciCompiler.cpp:140
      java.util.ServiceConfigurationError: jdk.vm.ci.services.JVMCIServiceLocator: Unable to load org.graalvm.compiler.hotspot.HotSpotGraalJVMCIServiceLocator
              at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:581)
              at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:862)
              at java.base/java.util.ServiceLoader.access$600(ServiceLoader.java:390)
              at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1076)
              at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
              at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
              at jdk.internal.vm.ci/jdk.vm.ci.services.JVMCIServiceLocator.getProviders(JVMCIServiceLocator.java:87)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCICompilerConfig.getCompilerFactory(HotSpotJVMCICompilerConfig.java:90)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.<init>(HotSpotJVMCIRuntime.java:290)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.<init>(HotSpotJVMCIRuntime.java:65)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime$DelayedInit.<clinit>(HotSpotJVMCIRuntime.java:73)
              at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime(HotSpotJVMCIRuntime.java:83)
              at jdk.internal.vm.ci/jdk.vm.ci.runtime.JVMCI.initializeRuntime(Native Method)
              at jdk.internal.vm.ci/jdk.vm.ci.runtime.JVMCI.<clinit>(JVMCI.java:58)
      Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.jdk.vm.ci.services")
              at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
              at java.base/java.security.AccessController.checkPermission(AccessController.java:895)
              at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:558)
              at java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1534)
              at java.base/java.lang.ClassLoader$1.run(ClassLoader.java:680)
              at java.base/java.lang.ClassLoader$1.run(ClassLoader.java:678)
              at java.base/java.security.AccessController.doPrivileged(Native Method)
              at java.base/java.lang.ClassLoader.checkPackageAccess(ClassLoader.java:678)
              at java.base/java.lang.ClassLoader.defineClass1(Native Method)
              at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1006)
              at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1085)
              at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:206)
              at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:760)
              at java.base/jdk.internal.loader.BuiltinClassLoader.lambda$findClassInModuleOrNull$2(BuiltinClassLoader.java:683)
              at java.base/java.security.AccessController.doPrivileged(Native Method)
              at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:684)
              at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:562)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:607)
              at java.base/java.lang.Class.forName(Class.java:451)
              at java.base/java.util.ServiceLoader.lambda$loadProvider$1(ServiceLoader.java:856)
              at java.base/java.security.AccessController.doPrivileged(Native Method)
              at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:858)
              ... 12 more
      {code}

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kvn Vladimir Kozlov
                Reporter:
                jtulach Jaroslav Tulach
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: