Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-252

SshException MAC Error in org.apache.sshd.common.session.AbstractSession.decode when using Nio2ServiceFactory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.9.0
    • 0.10.0
    • None

    Description

      I've been running an extended version of the LoadTest.testLoad() test to verify a performance improvement I'm working on. While running these tests, I've noticed that the test fails occasionally, but only when using the NioServiceFactory.

      The following error is logged:

      org.apache.sshd.common.SshException: MAC Error
      at org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:559)
      at org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:253)
      at org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:54)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:231)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker.invokeDirect(Invoker.java:145)
      at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:275)
      at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:296)
      at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:407)
      at org.apache.sshd.common.io.nio2.Nio2Session.startReading(Nio2Session.java:217)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:232)
      at org.apache.sshd.common.io.nio2.Nio2Session$2.completed(Nio2Session.java:217)
      at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
      at sun.nio.ch.Invoker$2.run(Invoker.java:206)
      at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:724)

      I've reproduced these failures against an unmodified 0.9.0 version with the following test (see attachement for patch)

      Attachments

        1. loadtest.patch
          1 kB
          Michael Heemskerk

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              mheemskerk Michael Heemskerk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: