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

Deadlock in JNDI LDAP implementation when closing the LDAP context

    Details

      Backports

        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...

          Activity

          Hide
          coffeys Sean Coffey added a comment -
          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)

          ==
          Show
          coffeys Sean Coffey added a comment - 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) ==
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/bc949d71fd9d
          User: robm
          Date: 2015-09-17 22:00:03 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/bc949d71fd9d User: robm Date: 2015-09-17 22:00:03 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/bc949d71fd9d
          User: lana
          Date: 2015-09-23 23:04:33 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/bc949d71fd9d User: lana Date: 2015-09-23 23:04:33 +0000

            People

            • Assignee:
              robm Robert Mckenna
              Reporter:
              shadowbug Shadow Bug
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: