JDK-8156765 : threads stuck trying to acquire unowned reentrantlock
  • Type: Bug
  • Status: Resolved
  • Resolution: Not an Issue
  • Component: core-libs
  • Sub-Component: java.util.concurrent
  • Priority: P3
  • Affected Version: 7u101
  • Submit Date: 2016-05-11
  • Updated Date: 2016-05-23
  • Resolved Date: 2016-05-23
Description
The submitter's Server enters into a critical state with several threads stuck in attempting to acquire lock java.util.concurrent.locks.ReentrantLock$NonfairSync

Error-Stack Obtained / Diagnostic Analysis:
-------------------------------------------
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0x00000006a79c1a48> (a
java.util.concurrent.locks.ReentrantLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:867)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:214)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:290)
at oracle.jbo.mom.DefinitionContext.lock(DefinitionContext.java:550)
at oracle.jbo.mom.DefinitionManager.getSiteLock(DefinitionManager.java:4710)
at oracle.jbo.mom.DefinitionManager.lockDefinitionContext(DefinitionManager.java:4667)
at oracle.jbo.mom.DefinitionContextAgeable.cleanNullRefs(DefinitionContextAgeable.java:253)


Although these logs don't show the threads stuck on lock NonfairSync there
are several threads waiting for the NonfairSync lock but no thread in the
logs is holding that lock (0x00000006a79c1a48) .
Comments
The stack traces (with concurrent locks information) collected from the latest runs show that the concurrent locks are held by the application threads
2016-05-23

Yes StackOverflowError is the most likely cause of this.
2016-05-11

It could be due to StackOverflow while trying to unlock, which is sort-of fixed in jdk9.
2016-05-11

This could be similar to past reports : https://bugs.openjdk.java.net/browse/JDK-8032382 https://bugs.openjdk.java.net/browse/JDK-7011862
2016-05-11