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

Regression in DirectByteBufferDeallocator using Unsafe with Java 11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 2.0.15.Final
    • Core
    • None
    • Hide

      FormDataParser formDataParser = new FormEncodedDataDefinition().create(exchange);
      if (formDataParser != null) {
      exchange.startBlocking();
      formData = formDataParser.parseBlocking();
      }

      Show
      FormDataParser formDataParser = new FormEncodedDataDefinition().create(exchange); if (formDataParser != null) { exchange.startBlocking(); formData = formDataParser.parseBlocking(); }

    Description

      The same code is working absolutely fine with Java 10.0.2 and Java 10 modules.

      14:18:44.417 [XNIO-1 task-13] ERROR io.undertow.request - UT005071: Undertow request failed HttpServerExchange{ POST /callback request

      {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8], Accept-Language=[en-US,en;q=0.9,ru;q=0.8], Cache-Control=[max-age=0], Accept-Encoding=[gzip, deflate, br], DNT=[1], Origin=[https://login.microsoftonline.com], User-Agent=[Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36], Connection=[keep-alive], Content-Length=[1486], Content-Type=[application/x-www-form-urlencoded], Upgrade-Insecure-Requests=[1], Host=[localhost:8443]}

      response {Connection=[keep-alive], Content-Length=[0], Date=[Sun, 18 Nov 2018 19:18:44 GMT]}}
      java.lang.ExceptionInInitializerError: null
      at undertow.core@2.0.15.Final/io.undertow.server.DefaultByteBufferPool.queueIfUnderMax(DefaultByteBufferPool.java:209)
      at undertow.core@2.0.15.Final/io.undertow.server.DefaultByteBufferPool.freeInternal(DefaultByteBufferPool.java:201)
      at undertow.core@2.0.15.Final/io.undertow.server.DefaultByteBufferPool.access$200(DefaultByteBufferPool.java:41)
      at undertow.core@2.0.15.Final/io.undertow.server.DefaultByteBufferPool$DefaultPooledBuffer.close(DefaultByteBufferPool.java:271)
      at undertow.core@2.0.15.Final/io.undertow.protocols.ssl.SslConduit.doUnwrap(SslConduit.java:843)
      at undertow.core@2.0.15.Final/io.undertow.protocols.ssl.SslConduit.read(SslConduit.java:567)
      at xnio.api@3.3.8.Final/org.xnio.conduits.AbstractStreamSourceConduit.read(AbstractStreamSourceConduit.java:51)
      at undertow.core@2.0.15.Final/io.undertow.conduits.ReadDataStreamSourceConduit.read(ReadDataStreamSourceConduit.java:67)
      at undertow.core@2.0.15.Final/io.undertow.conduits.FixedLengthStreamSourceConduit.read(FixedLengthStreamSourceConduit.java:244)
      at xnio.api@3.3.8.Final/org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
      at undertow.core@2.0.15.Final/io.undertow.channels.DetachableStreamSourceChannel.read(DetachableStreamSourceChannel.java:209)
      at undertow.core@2.0.15.Final/io.undertow.server.HttpServerExchange$ReadDispatchChannel.read(HttpServerExchange.java:2341)
      at undertow.core@2.0.15.Final/io.undertow.server.handlers.form.FormEncodedDataDefinition$FormEncodedDataParser.doParse(FormEncodedDataDefinition.java:134)
      at undertow.core@2.0.15.Final/io.undertow.server.handlers.form.FormEncodedDataDefinition$FormEncodedDataParser.parseBlocking(FormEncodedDataDefinition.java:252)
      at auth.server/auth.server.auth.OIDCCallbackHandler.handleRequest(OIDCCallbackHandler.java:52)
      at undertow.core@2.0.15.Final/io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
      at undertow.core@2.0.15.Final/io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.RuntimeException: JDK did not allow accessing unsafe
      at undertow.core@2.0.15.Final/io.undertow.server.DirectByteBufferDeallocator.getUnsafe0(DirectByteBufferDeallocator.java:106)
      at undertow.core@2.0.15.Final/io.undertow.server.DirectByteBufferDeallocator.getUnsafe(DirectByteBufferDeallocator.java:97)
      at undertow.core@2.0.15.Final/io.undertow.server.DirectByteBufferDeallocator.<clinit>(DirectByteBufferDeallocator.java:46)
      ... 20 common frames omitted
      Caused by: java.lang.NoClassDefFoundError: sun/misc/Unsafe
      at undertow.core@2.0.15.Final/io.undertow.server.DirectByteBufferDeallocator.getUnsafe0(DirectByteBufferDeallocator.java:102)
      ... 22 common frames omitted
      Caused by: java.lang.ClassNotFoundException: sun.misc.Unsafe
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      ... 23 common frames omitted

      Attachments

        Activity

          People

            rhn-cservice-bbaranow Bartosz Baranowski
            smironov Stanislav Mironov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: