Uploaded image for project: 'XNIO'
  1. XNIO
  2. XNIO-334

Infinite loop in io.undertow.protocols.ssl.SslConduit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • None
    • ssl/tls
    • None
    • Hide

      Spring Boot project 2.1.2 + JDK 11 + Undertow 2.0.16 final + SSL + Some light stress test

      Looks like a concurrency issue

      Show
      Spring Boot project 2.1.2 + JDK 11 + Undertow 2.0.16 final + SSL + Some light stress test Looks like a concurrency issue

    Description

      Infinite loop in :
      package io.undertow.protocols.ssl;

      public class SslConduit implements StreamSourceConduit, StreamSinkConduit {

      try {
      SSLEngineResult result = null;
      while (result == null || (result.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_WRAP && result.getStatus() != SSLEngineResult.Status.BUFFER_OVERFLOW)) {
      if (userBuffers == null)

      { result = engine.wrap(EMPTY_BUFFER, wrappedData.getBuffer()); }

      else

      { result = engine.wrap(userBuffers, off, len, wrappedData.getBuffer()); }

      }

      ----------

      package io.undertow.server;

      /**

      • A byte buffer pool that supports reference counted pools.
        *
      • TODO: move this somewhere more appropriate
        *
      • @author Stuart Douglas
        */
        public class DefaultByteBufferPool implements ByteBufferPool {

      ...

      @Override
      public ByteBuffer getBuffer() {
      if(referenceCount == 0)

      { throw UndertowMessages.MESSAGES.bufferAlreadyFreed(); }

      return buffer;
      }

      Looping on while condition with the following state :

      HandshakeStatus = NEED_WRAP / Status = OK / bytesConsumed = 0 / bytesProduced = 0

      Stake trace :

      "XNIO-1 I/O-1" #25 prio=5 os_prio=0 cpu=3989340.17ms elapsed=64540.00s tid=0x00007fcd60cd7000 nid=0x7c0f runnable [0x00007fcd29a56000]
      java.lang.Thread.State: RUNNABLE
      at io.undertow.protocols.ssl.SslConduit.doWrap(SslConduit.java:898)
      at io.undertow.protocols.ssl.SslConduit.doUnwrap(SslConduit.java:671)
      at io.undertow.protocols.ssl.SslConduit.read(SslConduit.java:567)
      at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
      at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:158)
      at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
      at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
      at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
      at io.undertow.protocols.ssl.SslConduit$SslReadReadyHandler.readReady(SslConduit.java:1175)
      at io.undertow.protocols.ssl.SslConduit$SslWriteReadyHandler.writeReady(SslConduit.java:1250)
      at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:93)
      at org.xnio.nio.WorkerThread.run(WorkerThread.java:561)

      Attachments

        Activity

          People

            Unassigned Unassigned
            giguereth Thierry Giguère (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: