Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2620

Compressed requests bigger than 16KB fail with UT000091: Buffer has already been freed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.3.19.Final
    • Core
    • None
    • Hide

      {}Following test project has been created to reproduce the error: https://github.com/fmiguelez/test-undertow-2620

      The test suite includes two tests:

      •   A test with a small payload (less than 16KB) that succeeds.
      •   A test with a large payload (greater than 16KB) that fails, demonstrating the bug.

      If parent is changed to spring-boot-starter-parent:3.5.5 (instead of 3.5.6) tests pass.

       

       

      Show
      { }Following test project has been created to reproduce the error: https://github.com/fmiguelez/test-undertow-2620 The test suite includes two tests:   A test with a small payload (less than 16KB) that succeeds.   A test with a large payload (greater than 16KB) that fails, demonstrating the bug. If parent is changed to spring-boot-starter-parent:3.5.5 (instead of 3.5.6) tests pass.    

      When RequestEncodingHandler is configured to accept encoding "GZIP" and content exceeds 16KB following error is raised:

       

      java.lang.IllegalStateException: UT000091: Buffer has already been freed
              at io.undertow.server.DefaultByteBufferPool$DefaultPooledBuffer.getBuffer(DefaultByteBufferPool.java:269) ~[undertow-core-2.3.19.Final.jar:2.3.19.Final]
              at io.undertow.conduits.InflatingStreamSourceConduit.read(InflatingStreamSourceConduit.java:130) ~[undertow-core-2.3.19.Final.jar:2.3.19.Final]
              at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127) ~[xnio-api-3.8.16.Final.jar:3.8.16.Final]
              at io.undertow.channels.DetachableStreamSourceChannel.read(DetachableStreamSourceChannel.java:206) ~[undertow-core-2.3.19.Final.jar:2.3.19.Final]
              at io.undertow.server.HttpServerExchange$ReadDispatchChannel.read(HttpServerExchange.java:2480) ~[undertow-core-2.3.19.Final.jar:2.3.19.Final]
              at org.xnio.channels.Channels.readBlocking(Channels.java:344) ~[xnio-api-3.8.16.Final.jar:3.8.16.Final]
              at io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:201) ~[undertow-servlet-2.3.19.Final.jar:2.3.19.Final]
              at io.undertow.servlet.spec.ServletInputStreamImpl.close(ServletInputStreamImpl.java:266) ~[undertow-servlet-2.3.19.Final.jar:2.3.19.Final]
              at io.undertow.servlet.spec.HttpServletRequestImpl.closeAndDrainRequest(HttpServletRequestImpl.java:728) ~[undertow-servlet-2.3.19.Final.jar:2.3.19.Final]
              at io.undertow.servlet.core.ServletBlockingHttpExchange.close(ServletBlockingHttpExchange.java:89) ~[undertow-servlet-2.3.19.Final.jar:2.3.19.Final]
              at io.undertow.server.HttpServerExchange.endExchange(HttpServerExchange.java:1744) ~[undertow-core-2.3.19.Final.jar:2.3.19.Final]
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:420) ~[undertow-core-2.3.19.Final.jar:2.3.19.Final]
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:896) ~[undertow-core-2.3.19.Final.jar:2.3.19.Final]
              at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) ~[jboss-threads-3.7.0.Final.jar:3.7.0.Final]
              at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2691) ~[jboss-threads-3.7.0.Final.jar:3.7.0.Final]
              at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2670) ~[jboss-threads-3.7.0.Final.jar:3.7.0.Final]
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1589) ~[jboss-threads-3.7.0.Final.jar:3.7.0.Final]
              at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) ~[xnio-api-3.8.16.Final.jar:3.8.16.Final]
              at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
      

      Such error does not affect 2.3.18.Final. It might have been introduced by fix for UNDERTOW-2340

              flaviarnn Flavia Rainone
              fmiguelez Fernando Miguelez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: