Directory Client API
  1. Directory Client API
  2. DIRAPI-83

Debug logging causes never ending loop whn decoding messages

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-M11
    • Fix Version/s: 1.0.0-M12
    • Labels:
      None
    • Environment:
      Fedora 16 x64, Java 7, OpenLDAP 2.4.26

      Description

      When a lookup for an entry is done with debug enabled the message decoding goes into a continuous loop till the search times out. This happens with OpenLDAP when the "ERR_00043_REMAINING_BYTES_FOR_DECODED_PDU The PDU has been fully decoded but there are still bytes in the buffer." error occurs

      I don't have a test case but a simple LdapConnection.lookup with debug logging enabled causes this.

      The fix looks pretty straightforward - the actual offending code is in org.apache.directory.shared.ldap.codec.protocol.mina.LdapProtocolDecoder.decode(). The buffer.position is set(:134) and reset(:145) without a mark being set.

      The workaround is to turn off debug logging for the "org.apache.directory" logger

        Activity

        Hide
        Emmanuel Lecharny added a comment -

        I'm not even sure why we set and reset the buffer... This is probably due to some old code that was using something else than array() to read the ByteBuffer, but as array() returns the internal byte[], there is no need for those two guys.

        Show
        Emmanuel Lecharny added a comment - I'm not even sure why we set and reset the buffer... This is probably due to some old code that was using something else than array() to read the ByteBuffer, but as array() returns the internal byte[], there is no need for those two guys.
        Show
        Emmanuel Lecharny added a comment - Fixed with http://svn.apache.org/viewvc?rev=1332472&view=rev
        Hide
        Emmanuel Lecharny added a comment -

        There were a wrong log level (WARNING instead of DEBUG) here. This is supposed to be an informative message, when more than one LdapMessage is contained into a PDU. Nothing wrong, just a scarrying warning.

        Changed the log level in http://svn.apache.org/viewvc?rev=1418379&view=rev

        Show
        Emmanuel Lecharny added a comment - There were a wrong log level (WARNING instead of DEBUG) here. This is supposed to be an informative message, when more than one LdapMessage is contained into a PDU. Nothing wrong, just a scarrying warning. Changed the log level in http://svn.apache.org/viewvc?rev=1418379&view=rev

          People

          • Assignee:
            Unassigned
            Reporter:
            Sumit Raja
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development