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

VarHandle usages in LockSupport and ThreadLocalRandom result in circularity issues

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:

      Backports

        Description

        This has been observed on Solaris Sparcv9.
        It timed out, but actually there are NoClassDefFoundErr in system err:

        ----------System.err:(66/5876)----------
        java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.locks.LockSupport
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.unparkSuccessor(AbstractQueuedSynchronizer.java:697)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.cancelAcquire(AbstractQueuedSynchronizer.java:814)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:907)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1226)
        at java.base/java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:267)
        at java.logging/java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:358)
        at java.logging/java.util.logging.LogManager.getLogManager(LogManager.java:430)
        at java.logging/java.util.logging.Logger.demandLogger(Logger.java:650)
        at java.logging/java.util.logging.Logger.getLogger(Logger.java:719)
        at java.logging/java.util.logging.Logger.getLogger(Logger.java:703)
        at TestGetGlobalConcurrent.test2(TestGetGlobalConcurrent.java:81)
        at TestGetGlobalConcurrent$Run2.run(TestGetGlobalConcurrent.java:142)
        at TestGetGlobalConcurrent$WaitAndRun.run(TestGetGlobalConcurrent.java:131)
        at java.base/java.lang.Thread.run(Thread.java:844)
        java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.locks.LockSupport
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:871)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:903)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1226)
        at java.base/java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:267)
        at java.logging/java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:358)
        at java.logging/java.util.logging.LogManager.getLogManager(LogManager.java:430)
        at java.logging/java.util.logging.Logger.getGlobal(Logger.java:505)
        at TestGetGlobalConcurrent.main(TestGetGlobalConcurrent.java:172)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:543)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
        at java.base/java.lang.Thread.run(Thread.java:844)
        java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.locks.LockSupport
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:871)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:903)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1226)
        at java.base/java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:267)
        at java.logging/java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:358)
        at java.logging/java.util.logging.LogManager.getLogManager(LogManager.java:430)
        at TestGetGlobalConcurrent.test3(TestGetGlobalConcurrent.java:93)
        at TestGetGlobalConcurrent$Run3.run(TestGetGlobalConcurrent.java:145)
        at TestGetGlobalConcurrent$WaitAndRun.run(TestGetGlobalConcurrent.java:131)
        at java.base/java.lang.Thread.run(Thread.java:844)
        java.lang.NoClassDefFoundError: Could not initialize class java.util.concurrent.locks.LockSupport
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.unparkSuccessor(AbstractQueuedSynchronizer.java:697)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.cancelAcquire(AbstractQueuedSynchronizer.java:814)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:907)
        at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1226)
        at java.base/java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:267)
        at java.logging/java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:358)
        at java.logging/java.util.logging.LogManager.getLogManager(LogManager.java:430)
        at java.logging/java.util.logging.Logger.getGlobal(Logger.java:505)
        at TestGetGlobalConcurrent.test1(TestGetGlobalConcurrent.java:69)
        at TestGetGlobalConcurrent$Run1.run(TestGetGlobalConcurrent.java:139)
        at TestGetGlobalConcurrent$WaitAndRun.run(TestGetGlobalConcurrent.java:131)
        at java.base/java.lang.Thread.run(Thread.java:844

          Activity

          Hide
          dholmes David Holmes added a comment -
          Unfortunately the original ExceptionInInitializerError that should have been thrown if the LockSuppport class's static initializer threw an exception, is not visible. It looks like some part of the jtreg code may have swallowed it. If this is reproducible stand-alone then enable exception logging in the VM (-Xlog:exceptions=trace) to see where the original exception happens, and hopefully why.
          Show
          dholmes David Holmes added a comment - Unfortunately the original ExceptionInInitializerError that should have been thrown if the LockSuppport class's static initializer threw an exception, is not visible. It looks like some part of the jtreg code may have swallowed it. If this is reproducible stand-alone then enable exception logging in the VM (-Xlog:exceptions=trace) to see where the original exception happens, and hopefully why.
          Hide
          psandoz Paul Sandoz added a comment -
          This is related to JDK-8160710. I probably need to revert the Unsafe->VarHandle changes in LockSupport and TLR.
          Show
          psandoz Paul Sandoz added a comment - This is related to JDK-8160710 . I probably need to revert the Unsafe->VarHandle changes in LockSupport and TLR.
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/f1b7d60adc19
          User: psandoz
          Date: 2017-01-20 16:20:41 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/f1b7d60adc19 User: psandoz Date: 2017-01-20 16:20:41 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/f1b7d60adc19
          User: lana
          Date: 2017-01-25 21:47:12 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/f1b7d60adc19 User: lana Date: 2017-01-25 21:47:12 +0000

            People

            • Assignee:
              psandoz Paul Sandoz
              Reporter:
              xiaofeya Felix Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: