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

Spring Boot 3.4.0 Native Image fails on Netty netty-common-4.1.115. java.lang.NoSuchFieldException: producerIndex #43273

Closed
rowi1de opened this issue Nov 23, 2024 · 3 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@rowi1de
Copy link

rowi1de commented Nov 23, 2024

Using Spring Boot 3.4.0 Native Image fails on Netty netty-common-4.1.115. java.lang.NoSuchFieldException: producerIndex
See https://github.com/rowi1de/netty-native

2024-11-23 01:03:57 2024-11-23T00:03:57.949Z ERROR 1 --- [netty-native] [ctor-http-nio-2] r.netty.transport.ServerTransport        : [71e5e572, L:/172.18.0.4:8080 - R:/192.168.65.1:29377] onUncaughtException(SimpleConnection{channel=[id: 0x71e5e572, L:/172.18.0.4:8080 - R:/192.168.65.1:29377]})
2024-11-23 01:03:57 
2024-11-23 01:03:57 java.lang.ExceptionInInitializerError: null
2024-11-23 01:03:57     at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:604) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:604) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:604) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:604) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:604) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at [email protected]/java.lang.Class.ensureInitialized(DynamicHub.java:604) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at io.netty.util.internal.PlatformDependent.newFixedMpscUnpaddedQueue(PlatformDependent.java:1102) ~[na:na]
2024-11-23 01:03:57     at io.netty.buffer.PoolThreadCache$MemoryRegionCache.<init>(PoolThreadCache.java:337) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.buffer.PoolThreadCache$SubPageMemoryRegionCache.<init>(PoolThreadCache.java:302) ~[na:na]
2024-11-23 01:03:57     at io.netty.buffer.PoolThreadCache.createSubPageCaches(PoolThreadCache.java:113) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.buffer.PoolThreadCache.<init>(PoolThreadCache.java:77) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.buffer.PooledByteBufAllocator$PoolThreadLocalCache.initialValue(PooledByteBufAllocator.java:541) ~[na:na]
2024-11-23 01:03:57     at io.netty.buffer.PooledByteBufAllocator$PoolThreadLocalCache.initialValue(PooledByteBufAllocator.java:518) ~[na:na]
2024-11-23 01:03:57     at io.netty.util.concurrent.FastThreadLocal.initialize(FastThreadLocal.java:177) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.util.concurrent.FastThreadLocal.get(FastThreadLocal.java:142) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:398) ~[na:na]
2024-11-23 01:03:57     at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.buffer.AbstractByteBufAllocator.ioBuffer(AbstractByteBufAllocator.java:140) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator$MaxMessageHandle.allocate(DefaultMaxMessagesRecvByteBufAllocator.java:120) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:150) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[na:na]
2024-11-23 01:03:57     at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[na:na]
2024-11-23 01:03:57     at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[na:na]
2024-11-23 01:03:57     at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[na:na]
2024-11-23 01:03:57     at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[na:na]
2024-11-23 01:03:57     at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[na:na]
2024-11-23 01:03:57     at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[na:na]
2024-11-23 01:03:57     at [email protected]/java.lang.Thread.runWith(Thread.java:1596) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at [email protected]/java.lang.Thread.run(Thread.java:1583) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:902) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:878) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57 Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: producerIndex
2024-11-23 01:03:57     at io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess.fieldOffset(UnsafeAccess.java:111) ~[na:na]
2024-11-23 01:03:57     at io.netty.util.internal.shaded.org.jctools.queues.unpadded.MpscUnpaddedArrayQueueProducerIndexField.<clinit>(MpscUnpaddedArrayQueue.java:38) ~[netty.graalvm.NettyNativeApiApplicationKt:4.1.115.Final]
2024-11-23 01:03:57     ... 32 common frames omitted
2024-11-23 01:03:57 Caused by: java.lang.NoSuchFieldException: producerIndex
2024-11-23 01:03:57     at [email protected]/java.lang.Class.checkField(DynamicHub.java:1044) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at [email protected]/java.lang.Class.getDeclaredField(DynamicHub.java:1159) ~[netty.graalvm.NettyNativeApiApplicationKt:na]
2024-11-23 01:03:57     at io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess.fieldOffset(UnsafeAccess.java:107) ~[na:na]
2024-11-23 01:03:57     ... 33 common frames omitted
2024-11-23 01:03:57 
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 23, 2024
@philwebb philwebb changed the title Spring Boot 3.4.0 Native Image fails on Netty netty-common-4.1.115. java.lang.NoSuchFieldException: producerIndex Spring Boot 3.4.0 Native Image fails on Netty netty-common-4.1.115. java.lang.NoSuchFieldException: producerIndex Nov 23, 2024
@snicoll
Copy link
Member

snicoll commented Nov 23, 2024

Thanks for trying the latest release. Before opening an issue, please review the release notes. There is a section about that particular issue.

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2024
@snicoll snicoll added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 23, 2024
@snicoll snicoll pinned this issue Nov 23, 2024
@rowi1de
Copy link
Author

rowi1de commented Nov 23, 2024

Thanks for trying the latest release. Before opening an issue, please review the release notes. There is a section about that particular issue.

@snicoll thanks for the hint, usually spring boot starters just work out of the box, will try this

@bclozel
Copy link
Member

bclozel commented Nov 23, 2024

@rowi1de it was either shipping with this Netty version or shipping with the one before and then: GHSA-xq3w-v528-46rv

rowi1de added a commit to rowi1de/netty-native that referenced this issue Nov 23, 2024
rowi1de added a commit to rowi1de/netty-native that referenced this issue Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants