Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NATIVE] NullPointerException on PlatformDependent0.newDirectBuffer #38139

Closed
lucaspouzac opened this issue Jan 11, 2024 · 4 comments
Closed
Labels
area/native-image kind/bug Something isn't working

Comments

@lucaspouzac
Copy link

Describe the bug

Since version 3.6.1 of quarkus, when starting the application, a nullpointerexception is thrown.

I think it's related to ticket #17839

Caused by: java.lang.Error: java.lang.NullPointerException
  at io.netty.util.internal.PlatformDependent0.newDirectBuffer(PlatformDependent0.java:620)
  at io.netty.util.internal.PlatformDependent0.allocateDirectNoCleaner(PlatformDependent0.java:579)
  at io.netty.util.internal.PlatformDependent.allocateDirectNoCleaner(PlatformDependent.java:774)
  at io.netty.buffer.UnpooledUnsafeNoCleanerDirectByteBuf.allocateDirect(UnpooledUnsafeNoCleanerDirectByteBuf.java:30)
  at io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf.allocateDirect(UnpooledByteBufAllocator.java:186)
  at io.netty.buffer.UnpooledDirectByteBuf.<init>(UnpooledDirectByteBuf.java:64)
  at io.netty.buffer.UnpooledUnsafeDirectByteBuf.<init>(UnpooledUnsafeDirectByteBuf.java:41)
  at io.netty.buffer.UnpooledUnsafeNoCleanerDirectByteBuf.<init>(UnpooledUnsafeNoCleanerDirectByteBuf.java:25)
  at io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf.<init>(UnpooledByteBufAllocator.java:181)
  at io.netty.buffer.UnpooledByteBufAllocator.newDirectBuffer(UnpooledByteBufAllocator.java:91)
  at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
  at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179)
  at io.netty.buffer.Unpooled.directBuffer(Unpooled.java:128)
  at io.netty.handler.codec.http.HttpObjectEncoder.<clinit>(HttpObjectEncoder.java:59)
  at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:595)
  at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:595)
  at io.netty.handler.codec.http.HttpClientCodec.<init>(HttpClientCodec.java:151)
  at io.netty.handler.codec.http.HttpClientCodec.<init>(HttpClientCodec.java:139)
  at io.netty.handler.codec.http.HttpClientCodec.<init>(HttpClientCodec.java:128)
  at io.netty.handler.codec.http.HttpClientCodec.<init>(HttpClientCodec.java:118)
  at io.vertx.core.http.impl.HttpChannelConnector.applyHttp1xConnectionOptions(HttpChannelConnector.java:176)
  at io.vertx.core.http.impl.HttpChannelConnector.wrap(HttpChannelConnector.java:137)
  at io.vertx.core.http.impl.HttpChannelConnector.lambda$httpConnect$0(HttpChannelConnector.java:146)
  at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:38)
  at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:60)
  at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:211)
  at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
  at io.vertx.core.Promise.complete(Promise.java:66)
  at io.vertx.core.net.impl.NetClientImpl.lambda$connected$9(NetClientImpl.java:338)
  at io.vertx.core.net.impl.VertxHandler.setConnection(VertxHandler.java:82)
  at io.vertx.core.net.impl.VertxHandler.handlerAdded(VertxHandler.java:88)
  at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:1114)
  at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
  at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:223)
  at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:195)
  at io.vertx.core.net.impl.NetClientImpl.connected(NetClientImpl.java:340)
  at io.vertx.core.net.impl.NetClientImpl.lambda$connectInternal2$3(NetClientImpl.java:302)
  at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:277)
  at io.vertx.core.net.impl.ChannelProvider.connected(ChannelProvider.java:172)
  at io.vertx.core.net.impl.ChannelProvider.lambda$handleConnect$0(ChannelProvider.java:155)
  at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590)
  at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583)
  at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559)
  at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492)
  at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636)
  at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625)
  at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:105)
  at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
  at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:300)
  at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:335)
  at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
  at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
  at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
  at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
  at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
  at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
  at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
  at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
  at [email protected]/java.lang.Thread.run(Thread.java:1583)
  at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:832)
  at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
Caused by: java.lang.NullPointerException
  at io.netty.util.internal.PlatformDependent0.newDirectBuffer(PlatformDependent0.java:614)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@lucaspouzac lucaspouzac added the kind/bug Something isn't working label Jan 11, 2024
Copy link

quarkus-bot bot commented Jan 11, 2024

/cc @zakkak (native-image)

@zakkak
Copy link
Contributor

zakkak commented Jan 11, 2024

@lucaspouzac it looks like #37626 (comment)

As mentioned in #37626 (comment) you can work around this by

removing quarkus.native.monitoring option jfr until Quarkus 3.6.5/3.7.0 OR the GraalVM for JDK 21.0.2 is realesed on January 23, 2024
Karm/mandrel-integration-tests#236
#37633
oracle/graal#8020
oracle/graal#8037

@lucaspouzac
Copy link
Author

I confirm that the workaround works. Thanks @zakkak !!

@zakkak
Copy link
Contributor

zakkak commented May 17, 2024

Should be fixed since 3.6.6 please reopen if not.

@zakkak zakkak closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants