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

[JMH] sun.misc.UnsafeOps cannot access class jdk.internal.misc.Unsafe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 24
    • performance
    • generic
    • generic

      * reproduce

      make test TEST="micro:UnsafeOps"

      * the snippet of error log

      java.lang.IllegalAccessError: class org.openjdk.bench.sun.misc.UnsafeOps (in unnamed module @0x5a2e4553) cannot access class jdk.internal.misc.Unsafe (in module java.base) becau
      se module java.base does not export jdk.internal.misc to unnamed module @0x5a2e4553
              at org.openjdk.bench.sun.misc.UnsafeOps.<clinit>(UnsafeOps.java:40)
              at org.openjdk.bench.sun.misc.jmh_generated.UnsafeOps_putLongOnHeap_jmhTest._jmh_tryInit_f_unsafeops0_0(UnsafeOps_putLongOnHeap_jmhTest.java:343)
              at org.openjdk.bench.sun.misc.jmh_generated.UnsafeOps_putLongOnHeap_jmhTest.putLongOnHeap_AverageTime(UnsafeOps_putLongOnHeap_jmhTest.java:141)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
              at java.base/java.lang.reflect.Method.invoke(Method.java:565)
              at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:527)
              at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:504)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1095)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:619)
              at java.base/java.lang.Thread.run(Thread.java:1447)

            haosun Hao Sun
            haosun Hao Sun
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: