Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-1084

100% CPU when using IoBuffer.shrink() method in some cases

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.7
    • Fix Version/s: None
    • Component/s: SSL
    • Labels:
      None
    • Environment:
      Any
    • Flags:
      Important

      Description

      "socket_c2s_ssl-thread-6" daemon prio=10 tid=0x82f5a000 nid=0x1355 runnable [0x7d618000]
         java.lang.Thread.State: RUNNABLE
          at org.apache.mina.core.buffer.AbstractIoBuffer.shrink(AbstractIoBuffer.java:317)
          at org.apache.mina.filter.ssl.SslHandler.fetchOutNetBuffer(SslHandler.java:406)
          at org.apache.mina.filter.ssl.SslHandler.writeNetBuffer(SslHandler.java:642)
          at org.apache.mina.filter.ssl.SslFilter.initiateClosure(SslFilter.java:665)
          at org.apache.mina.filter.ssl.SslFilter.filterClose(SslFilter.java:627)
          - locked <0x9f31fb80> (a org.apache.mina.filter.ssl.SslHandler)
      
      

      When one tries to shrink a buffer which minimal capacity is set to 0, and set the size to 0, it enter into an infinite loop.

      Bug https://issues.apache.org/jira/browse/DIRMINA-988 has created in 2.0.8 it was a similar bug, but the code is slightly different in 2.0.7. But the problem is same. We should acknowledge this issue is present in 2.0.7.

      This is due to this loop :

      while (newCapacity >>> 1 >= minCapacity) {
        newCapacity >>>= 1;
      }
      
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dhina_apec Dhinakaran Arumugam
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: