JDK-8129957 : Deadlock in JNDI LDAP implementation when closing the LDAP context
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.naming
  • Affected Version: 7u72
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-06-26
  • Updated: 2016-06-13
  • Resolved: 2015-09-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 JDK 8 JDK 9
6u111Fixed 7u95Fixed 8u72Fixed 9 b83Fixed
Description
Deadlock in LDAP code. 
. 
Found one Java-level deadlock: 
============================= 
"Thread-1926": 
  waiting to lock monitor 0x0000000001988f50 (object 0xfffffd7fe3946018, a 
com.sun.jndi.ldap.EventSupport), 
  which is held by "<ThreadName>" 
"LdapDatafillUpdateTimer": 
  waiting to lock monitor 0x0000000001021760 (object 0xfffffd7fe39463f8, a 
java.util.Vector), 
  which is held by "Thread-1926" 
. 
Java stack information for the threads listed above: 
=================================================== 
"Thread-1926": 
        at com.sun.jndi.ldap.LdapCtx.fireUnsolicited(LdapCtx.java:3529) 
        - waiting to lock <0xfffffd7fe3946018> (a 
com.sun.jndi.ldap.EventSupport) 
        at 
com.sun.jndi.ldap.LdapClient.notifyUnsolicited(LdapClient.java:1574) 
        at 
com.sun.jndi.ldap.LdapClient.processConnectionClosure(LdapClient.java:504) 
        - locked <0xfffffd7fe39463f8> (a java.util.Vector) 
        at com.sun.jndi.ldap.Connection.cleanup(Connection.java:693) 
        at com.sun.jndi.ldap.Connection.run(Connection.java:992) 
        at java.lang.Thread.run(Thread.java:745) 
"<ThreadName>": 
        at 
com.sun.jndi.ldap.LdapClient.removeUnsolicited(LdapClient.java:1498) 
        - waiting to lock <0xfffffd7fe39463f8> (a java.util.Vector) 
        at com.sun.jndi.ldap.LdapCtx.removeUnsolicited(LdapCtx.java:3513) 
        - locked <0xfffffd7fe3946018> (a com.sun.jndi.ldap.EventSupport) 
        at com.sun.jndi.ldap.LdapCtx.close(LdapCtx.java:2581) 
        - locked <0xfffffd7fe3945eb0> (a com.sun.jndi.ldap.LdapCtx) 
        at xxx.closeEventContext(LdapContextManager.java:49) 
        ... removed... 
Comments
more info from support engineer : == Looked thru 7u76 src code and 8u31 src code. We are grabbing the locks in different order, hence the deadlock. . The "Thread-1926" lock sequence is <0xfffffd7fe39463f8> (a java.util.Vector) followed by attempting to lock. <0xfffffd7fe3946018> (a com.sun.jndi.ldap.EventSupport) . The LdapDatafillUpdateTime is <0xfffffd7fe3946018> (a com.sun.jndi.ldap.EventSupport) attempting to lock <0xfffffd7fe39463f8> (a java.util.Vector) ==
26-06-2015