JDK-8159822 : Non-synchronized access to shared members of com.sun.jndi.ldap.pool.Pool
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.naming
  • Affected Version: 7u101,9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-06-17
  • Updated: 2016-10-13
  • Resolved: 2016-07-03
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
6u131Fixed 7u121Fixed 8u112Fixed 9 b126Fixed
Description
Access to com.sun.jndi.ldap.pool.Pool.map isn't synchronized in several executing paths: in methods toString(), showStats() and getPooledConnection().

In particular, this results in ConcurrentModificationException when debug information is on.

Example of a stack trace with CME:
Caused By: java.util.ConcurrentModificationException 
        at java.util.WeakHashMap$HashIterator.nextEntry(WeakHashMap.java:882) 
        at java.util.WeakHashMap$EntryIterator.next(WeakHashMap.java:921) 
        at java.util.WeakHashMap$EntryIterator.next(WeakHashMap.java:919) 
        at java.util.AbstractMap.toString(AbstractMap.java:518) 
        at com.sun.jndi.ldap.pool.Pool.toString(Pool.java:229) 
        at java.lang.String.valueOf(String.java:2849) 
        at java.lang.StringBuilder.append(StringBuilder.java:128) 
        at com.sun.jndi.ldap.pool.Pool.d(Pool.java:240) 
        at com.sun.jndi.ldap.pool.Pool.getPooledConnection(Pool.java:120) 
        at 
com.sun.jndi.ldap.LdapPoolManager.getLdapClient(LdapPoolManager.java:329) 
        at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1603) 
        at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2699) 
        at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:317)