"BufferException: Underflow" exceptions from SSHD

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 6.7.0
    • Affects Version/s: 5.11.4.1
    • Component/s: Builds, Logs
    • 10
    • Severity 3 - Minor
    • 0

      Summary

      "BufferException: Underflow" warning is frequently logged out of SSHD server in Bamboo:

      Steps to Reproduce

      At this stage the cause and steps to reproduce this issue are unknown.

      Excepted Results

      Exception is well-handled.

      Actual Results

      Under certain circumstances the following errors are found in atlassian-bamboo.log:

      atlassian-bamboo.log
      2016-06-01 17:25:01,742 WARN [sshd-SshServer[491791c4]-nio2-thread-4] [ServerSessionImpl] exceptionCaught(ServerSessionImpl[72c0dd86-6efb-4b44-b39a-e05979b1b8f1@/127.0.0.1:49136])[state=Opened] BufferException: Underflow
      

      TRACE log:

      atlassian-bamboo.log
      2016-06-01 13:08:17,433 TRACE [sshd-SshServer[7a2cdaa7]-nio2-thread-7] [ServerSessionImpl] decode(ServerSessionImpl[a55d4e4f-46a4-4da2-b33e-5737fb3e399e@/127.0.0.1:45543]) packet #11 [chunk #1](5/5) 61 00 00 00 00
      2016-06-01 13:08:17,434 TRACE [sshd-SshServer[7a2cdaa7]-nio2-thread-7] [ServerSessionImpl] doHandleMessage(ServerSessionImpl[a55d4e4f-46a4-4da2-b33e-5737fb3e399e@/127.0.0.1:45543]) process SSH_MSG_CHANNEL_CLOSE
      2016-06-01 13:08:17,434 TRACE [sshd-SshServer[7a2cdaa7]-nio2-thread-7] [ServerSessionImpl] decode(ServerSessionImpl[a55d4e4f-46a4-4da2-b33e-5737fb3e399e@/127.0.0.1:45543]) packet #12 [chunk #1](29/29) 01 00 00 00 0b 00 00 00 14 64 69 73 63 6f 6e 6e 65 63 74 65 64 20 62 79 20 75 73 65 72
      2016-06-01 13:08:17,434 TRACE [sshd-SshServer[7a2cdaa7]-nio2-thread-7] [ServerSessionImpl] doHandleMessage(ServerSessionImpl[a55d4e4f-46a4-4da2-b33e-5737fb3e399e@/127.0.0.1:45543]) process SSH_MSG_DISCONNECT
      2016-06-01 13:08:17,434 WARN [sshd-SshServer[7a2cdaa7]-nio2-thread-7] [ServerSessionImpl] exceptionCaught(ServerSessionImpl[a55d4e4f-46a4-4da2-b33e-5737fb3e399e@/127.0.0.1:45543])[state=Opened] BufferException: Underflow
      2016-06-01 13:08:17,434 DEBUG [sshd-SshServer[7a2cdaa7]-nio2-thread-7] [ServerSessionImpl] exceptionCaught(ServerSessionImpl[a55d4e4f-46a4-4da2-b33e-5737fb3e399e@/127.0.0.1:45543])[state=Opened] details
      org.apache.sshd.common.util.buffer.BufferException: Underflow
      	at org.apache.sshd.common.util.buffer.Buffer.ensureAvailable(Buffer.java:411)
      	at org.apache.sshd.common.util.buffer.Buffer.getUInt(Buffer.java:155)
      	at org.apache.sshd.common.util.buffer.Buffer.getInt(Buffer.java:150)
      	at org.apache.sshd.common.util.buffer.ByteArrayBuffer.getString(ByteArrayBuffer.java:160)
      	at org.apache.sshd.common.util.buffer.Buffer.getString(Buffer.java:180)
      	at org.apache.sshd.common.session.helpers.AbstractSession.handleDisconnect(AbstractSession.java:641)
      	at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:493)
      	at org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:463)
      	at org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1325)
      	at org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:424)
      	at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:67)
      	at org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:285)
      	at org.apache.sshd.common.io.nio2.Nio2Session$2.onCompleted(Nio2Session.java:265)
      	at org.apache.sshd.common.io.nio2.Nio2Session$2.onCompleted(Nio2Session.java:262)
      	at org.apache.sshd.common.io.nio2.Nio2CompletionHandler$1.run(Nio2CompletionHandler.java:37)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:34)
      	at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      	at sun.nio.ch.Invoker$2.run(Invoker.java:218)
      	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      Notes

      To our knowledge there is no known impact or user-visible effect from these exceptions, and ssh-related behavior is otherwise normal.

      Workaround

      It's possible that if running an older version of OpenSSH (pre 5.5), upgrading OpenSSH may help.

            Assignee:
            Unassigned
            Reporter:
            Dave Chevell
            Votes:
            7 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: