Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1523 Review and fix tests that keep failing
  3. UNDERTOW-1446

Tests intermittently fail with Buffer Leak exception

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.0.16.Final
    • None
    • None

      Undertov revision: 11535603e11cdaa573fde6543c4fcf6dc309f3db
      Tests fail intermittently with Buffer Leak Exception and don't depend on Java version or platform.

      java.lang.RuntimeException: Buffer Leak io.undertow.server.ssl.ComplexSSLTestCase.complexSSLTestCase
      08:58:49 	at io.undertow.testutils.DefaultServer$2.testFinished(DefaultServer.java:289)
      08:58:49 	at org.junit.runner.notification.SynchronizedRunListener.testFinished(SynchronizedRunListener.java:56)
      08:58:49 	at org.junit.runner.notification.RunNotifier$7.notifyListener(RunNotifier.java:190)
      08:58:49 	at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
      08:58:49 	at org.junit.runner.notification.RunNotifier.fireTestFinished(RunNotifier.java:187)
      08:58:49 	at org.junit.internal.runners.model.EachTestNotifier.fireTestFinished(EachTestNotifier.java:38)
      08:58:49 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:331)
      08:58:49 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      08:58:49 	at io.undertow.testutils.DefaultServer.runChild(DefaultServer.java:524)
      08:58:49 	at io.undertow.testutils.DefaultServer.runChild(DefaultServer.java:104)
      08:58:49 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      08:58:49 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      08:58:49 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      08:58:49 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      08:58:49 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      08:58:49 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      08:58:49 	at io.undertow.testutils.DefaultServer.run(DefaultServer.java:297)
      08:58:49 	at org.junit.runners.Suite.runChild(Suite.java:128)
      08:58:49 	at org.junit.runners.Suite.runChild(Suite.java:27)
      08:58:49 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      08:58:49 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      08:58:49 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      08:58:49 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      08:58:49 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      08:58:49 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      08:58:49 	at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55)
      08:58:49 	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137)
      08:58:49 	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107)
      08:58:49 	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83)
      08:58:49 	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)
      08:58:49 	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:158)
      08:58:49 	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
      08:58:49 	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
      08:58:49 	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
      08:58:49 	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
      08:58:49 Caused by: java.lang.RuntimeException: java.nio.DirectByteBuffer[pos=0 lim=8192 cap=8192] NO: 131832 [NO_CONTEXT]
      08:58:49 	at io.undertow.testutils.DebuggingSlicePool$DebuggingBuffer.<init>(DebuggingSlicePool.java:84)
      08:58:49 	at io.undertow.testutils.DebuggingSlicePool.allocate(DebuggingSlicePool.java:45)
      08:58:49 	at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:163)
      08:58:49 	at io.undertow.server.handlers.resource.PathResource.serveImpl(PathResource.java:253)
      08:58:49 	at io.undertow.server.handlers.resource.PathResource.serve(PathResource.java:111)
      08:58:49 	at io.undertow.server.handlers.resource.ResourceHandler$1.handleRequest(ResourceHandler.java:337)
      08:58:49 	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
      08:58:49 	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
      08:58:49 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      08:58:49 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      08:58:49 	at java.lang.Thread.run(Thread.java:748)
      

      Can be seen in following tests:

      io.undertow.server.ssl.SimpleSSLTestCase.parallelWithDispatch
      io.undertow.servlet.test.streams.ServletInputStreamRequestBufferingTestCase.testAsyncServletInputStreamInParallel[proxy][http2-clear-upgrade]
      io.undertow.server.ssl.ComplexSSLTestCase.complexSSLTestCase
      

      The following is from failed ComplexSSLTestCase.complexSSLTestCase test:

      13:18:11,109 ERROR (XNIO-1 task-12) [io.undertow.request] <Connectors.java:398> UT005071: Undertow request failed HttpServerExchange{ GET /page.html request {Connection=[Keep-Alive], User-Agent=[Apache-HttpClient/4.5.6 (Java/1.8.0_191)], Host=[localhost:7778]} response {Connection=[keep-alive], Last-Modified=[Tue, 27 Nov 2018 13:17:21 GMT], Content-Length=[806], Content-Type=[text/html], Accept-Ranges=[bytes], Date=[Tue, 27 Nov 2018 13:18:11 GMT]}}: java.lang.NullPointerException
      	at io.undertow.protocols.ssl.SslConduit.doWrap(SslConduit.java:920)
      	at io.undertow.protocols.ssl.SslConduit.write(SslConduit.java:379)
      	at io.undertow.conduits.BytesSentStreamSinkConduit.write(BytesSentStreamSinkConduit.java:76)
      	at io.undertow.server.protocol.http.HttpResponseConduit.processWrite(HttpResponseConduit.java:251)
      	at io.undertow.server.protocol.http.HttpResponseConduit.write(HttpResponseConduit.java:598)
      	at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.write(AbstractFixedLengthStreamSinkConduit.java:106)
      	at org.xnio.conduits.ConduitStreamSinkChannel.write(ConduitStreamSinkChannel.java:150)
      	at io.undertow.channels.DetachableStreamSinkChannel.write(DetachableStreamSinkChannel.java:240)
      	at io.undertow.server.HttpServerExchange$WriteDispatchChannel.write(HttpServerExchange.java:2103)
      	at io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:160)
      	at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:184)
      	at io.undertow.server.handlers.resource.PathResource.serveImpl(PathResource.java:253)
      	at io.undertow.server.handlers.resource.PathResource.serve(PathResource.java:111)
      	at io.undertow.server.handlers.resource.ResourceHandler$1.handleRequest(ResourceHandler.java:337)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      
      java.lang.RuntimeException: java.nio.DirectByteBuffer[pos=0 lim=8192 cap=8192] NO: 131299 [NO_CONTEXT]
      	at io.undertow.testutils.DebuggingSlicePool$DebuggingBuffer.<init>(DebuggingSlicePool.java:84)
      	at io.undertow.testutils.DebuggingSlicePool.allocate(DebuggingSlicePool.java:45)
      	at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:163)
      	at io.undertow.server.handlers.resource.PathResource.serveImpl(PathResource.java:253)
      	at io.undertow.server.handlers.resource.PathResource.serve(PathResource.java:111)
      	at io.undertow.server.handlers.resource.ResourceHandler$1.handleRequest(ResourceHandler.java:337)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      java.lang.Throwable: Buffer leak detected
      	at io.undertow.server.DefaultByteBufferPool$LeakDetector.<init>(DefaultByteBufferPool.java:314)
      	at io.undertow.server.DefaultByteBufferPool$LeakDetector.<init>(DefaultByteBufferPool.java:308)
      	at io.undertow.server.DefaultByteBufferPool$DefaultPooledBuffer.<init>(DefaultByteBufferPool.java:254)
      	at io.undertow.server.DefaultByteBufferPool.allocate(DefaultByteBufferPool.java:157)
      	at io.undertow.testutils.DebuggingSlicePool.allocate(DebuggingSlicePool.java:44)
      	at io.undertow.server.handlers.resource.PathResource$1ServerTask.run(PathResource.java:163)
      	at io.undertow.server.handlers.resource.PathResource.serveImpl(PathResource.java:253)
      	at io.undertow.server.handlers.resource.PathResource.serve(PathResource.java:111)
      	at io.undertow.server.handlers.resource.ResourceHandler$1.handleRequest(ResourceHandler.java:337)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      WRITE 16000000
      DONE 16000000
      WRITE 1600000
      DONE 1600000
      13:18:38,568 DEBUG (XNIO-1 I/O-1) [io.undertow.request.io] <HttpReadListener.java:160> Error reading request: java.io.IOException: Connection reset by peer
      	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
      	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
      	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
      	at sun.nio.ch.IOUtil.read(IOUtil.java:192)
      	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
      	at org.xnio.nio.NioSocketConduit.read(NioSocketConduit.java:319)
      	at io.undertow.protocols.ssl.SslConduit.doUnwrap(SslConduit.java:703)
      	at io.undertow.protocols.ssl.SslConduit.read(SslConduit.java:567)
      	at org.xnio.conduits.AbstractStreamSourceConduit.read(AbstractStreamSourceConduit.java:51)
      	at io.undertow.conduits.BytesReceivedStreamSourceConduit.read(BytesReceivedStreamSourceConduit.java:67)
      	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 org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88)
      	at org.xnio.nio.WorkerThread.run(WorkerThread.java:561)
      

              flaviarnn Flavia Rainone
              akrajcik@redhat.com Adam Krajcik
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: