GeezerVison is showing github.com — Native compilation of the `hibernate-reactive-mssql`, `hibernate-reactive-mysql`, `hibernate-reactive-mysql-agroal`, and `reactive-mysql-client` ITs fails when assertions are enabled on AArch64 · Issue #50469 · quarkusio/quarkus
Native compilation of the hibernate-reactive-mssql, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal, and reactive-mysql-client ITs fails when assertions are enabled on AArch64 #50469DescriptionDescribe the bug
Enabling assertions at native-image build time results in compilation failure for the hibernate-reactive-mssql, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal, and reactive-mysql-client integration test.
Expected behavior
Test should build and pass
Actual behavior
Test fails at runtime with:
2025-10-07 10:46:29,764 WARN [io.qua.hib.orm.run.ser.QuarkusRuntimeInitDialectFactory] (JPA Startup Thread) Persistence unit <default>: Could not retrieve the database version to check it is at least 13.0: java.util.concurrent.CompletionException: java.lang.AssertionError
at java.base@25-beta/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:323)
at java.base@25-beta/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:376)
at java.base@25-beta/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:391)
at java.base@25-beta/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1162)
at java.base@25-beta/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:531)
at java.base@25-beta/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2221)
at org.hibernate.reactive.pool.impl.SqlClientPool.lambda$completionStage$2(SqlClientPool.java:176)
at io.vertx.core.impl.future.FutureImpl$4.onFailure(FutureImpl.java:188)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.impl.future.Mapping.onFailure(Mapping.java:45)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.impl.future.Mapping.onFailure(Mapping.java:45)
at io.vertx.core.impl.future.FutureBase.lambda$emitFailure$1(FutureBase.java:75)
at io.vertx.core.impl.ContextImpl.execute(ContextImpl.java:312)
at io.vertx.core.impl.ContextImpl.execute(ContextImpl.java:302)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:72)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.impl.future.PromiseImpl.onFailure(PromiseImpl.java:54)
at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:43)
at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:23)
at io.vertx.sqlclient.impl.pool.SqlConnectionPool$1PoolRequest.handle(SqlConnectionPool.java:265)
at io.vertx.sqlclient.impl.pool.SqlConnectionPool$1PoolRequest.handle(SqlConnectionPool.java:235)
at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:342)
at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:335)
at io.vertx.core.net.impl.pool.SimpleConnectionPool$ConnectFailed$1.run(SimpleConnectionPool.java:380)
at io.vertx.core.net.impl.pool.Task.runNextTasks(Task.java:43)
at io.vertx.core.net.impl.pool.CombinerExecutor.submit(CombinerExecutor.java:91)
at io.vertx.core.net.impl.pool.SimpleConnectionPool.execute(SimpleConnectionPool.java:244)
at io.vertx.core.net.impl.pool.SimpleConnectionPool.lambda$connect$2(SimpleConnectionPool.java:258)
at io.vertx.sqlclient.impl.pool.SqlConnectionPool$2.lambda$connect$0(SqlConnectionPool.java:136)
at io.vertx.core.impl.future.FutureImpl$4.onFailure(FutureImpl.java:188)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.impl.future.Composition$1.onFailure(Composition.java:66)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.impl.future.PromiseImpl.onFailure(PromiseImpl.java:54)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.impl.future.Mapping.onFailure(Mapping.java:45)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.Promise.fail(Promise.java:89)
at io.vertx.sqlclient.impl.ConnectionFactoryBase.lambda$doConnectWithRetry$2(ConnectionFactoryBase.java:113)
at io.vertx.core.impl.future.FutureImpl$4.onFailure(FutureImpl.java:188)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.impl.future.Composition$1.onFailure(Composition.java:66)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FailedFuture.addListener(FailedFuture.java:98)
at io.vertx.core.impl.future.Composition.onFailure(Composition.java:55)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:278)
at io.vertx.core.impl.future.Composition$1.onFailure(Composition.java:66)
at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:81)
at io.vertx.core.impl.future.FutureImpl.addListener(FutureImpl.java:226)
at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:43)
at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259)
at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40)
at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66)
at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259)
at io.vertx.core.Promise.complete(Promise.java:66)
at io.vertx.core.net.impl.NetClientImpl.lambda$connected$9(NetClientImpl.java:342)
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:1130)
at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:558)
at io.netty.channel.DefaultChannelPipeline.internalAdd(DefaultChannelPipeline.java:203)
at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:227)
at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:222)
at io.vertx.core.net.impl.NetClientImpl.connected(NetClientImpl.java:344)
at io.vertx.core.net.impl.NetClientImpl.lambda$connectInternal2$3(NetClientImpl.java:306)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:270)
at io.vertx.core.net.impl.ChannelProvider.connected(ChannelProvider.java:181)
at io.vertx.core.net.impl.ChannelProvider.lambda$handleConnect$0(ChannelProvider.java:164)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:603)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:596)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:572)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:505)
at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:649)
at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:638)
at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:118)
at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:305)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:784)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:732)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:658)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base@25-beta/java.lang.Thread.runWith(Thread.java:1487)
at java.base@25-beta/java.lang.Thread.run(Thread.java:1474)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:832)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:808)
Caused by: java.lang.AssertionError
at io.netty.buffer.UnsafeByteBufUtil.setZero(UnsafeByteBufUtil.java:665)
at io.netty.buffer.PooledUnsafeDirectByteBuf.writeZero(PooledUnsafeDirectByteBuf.java:269)
at io.vertx.mssqlclient.impl.codec.PreLoginCommandCodec.encodeOption(PreLoginCommandCodec.java:56)
at io.vertx.mssqlclient.impl.codec.PreLoginCommandCodec.encode(PreLoginCommandCodec.java:38)
at io.vertx.mssqlclient.impl.codec.TdsMessageEncoder.write(TdsMessageEncoder.java:56)
at io.vertx.mssqlclient.impl.codec.TdsMessageEncoder.write(TdsMessageEncoder.java:47)
at io.netty.channel.CombinedChannelDuplexHandler.write(CombinedChannelDuplexHandler.java:346)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:891)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868)
at io.vertx.sqlclient.impl.SocketConnectionBase.checkPending(SocketConnectionBase.java:275)
at io.vertx.sqlclient.impl.SocketConnectionBase.doSchedule(SocketConnectionBase.java:226)
at io.vertx.mssqlclient.impl.MSSQLSocketConnection.doSchedule(MSSQLSocketConnection.java:152)
at io.vertx.sqlclient.impl.SocketConnectionBase.lambda$schedule$3(SocketConnectionBase.java:204)
at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:342)
at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:335)
at io.vertx.core.impl.ContextInternal.emit(ContextInternal.java:200)
at io.vertx.sqlclient.impl.SocketConnectionBase.schedule(SocketConnectionBase.java:204)
at io.vertx.mssqlclient.impl.MSSQLSocketConnection.sendPreLoginMessage(MSSQLSocketConnection.java:72)
at io.vertx.mssqlclient.impl.MSSQLConnectionFactory.lambda$connectOrRedirect$2(MSSQLConnectionFactory.java:55)
at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:38)
... 40 more
How to Reproduce?
./mvnw -pl integration-tests/hibernate-reactive-mssql \
-Dstart-containers -Dtest-containers -Dnative -Dnative.surefire.skip \
-Dformat.skip -Dno-descriptor-tests \
clean verify \
-Dquarkus.native.additional-build-args-append=-ea,-esa,-J-ea,-J-esa
Output of uname -a or ver
No response
Output of java -version
25-beta+36-ea
Mandrel or GraalVM version (if different from Java)
Mandrel-25.0.1.0-dev9688c68b
Quarkus version or git rev
95f89bc
Build tool (ie. output of mvnw --version or gradlew --version)
No response
Additional information
No response Activityquarkus-bot commented on Oct 8, 2025 jerboaa commented on Oct 9, 2025 Since the assertion comes from netty. /cc @franz1981 Reacted by Francesco Nigro franz1981 commented on Oct 9, 2025 Reacted by Marco Belladelli franz1981 commented on Oct 9, 2025 jerboaa commented on Oct 9, 2025 jerboaa commented on Oct 9, 2025 Other than that, ask @zakkak how to reproduce, I don't have any arm HW readily available, unfortunately. franz1981 commented on Oct 10, 2025 FYI sent netty/netty#15740 which I will back-port to 4.1. as soon as merged, but I think is still worthy @zakkak to clarify how we end up there.
I assume Unsafe to be avaialble so it means that native image doesn't allow to extract if the platform requires aligned accesses or not in the way Netty do (explained at #50469 (comment)). But this change performance a LOT , because many optimized methods happen if unaligned accesses are allowed (thinking about bulk encoding/decoding/hashing/copy etc etc).
In short, if the platform allow unaligned accesses we should find a way to correctly detect it, to have good performance. Reacted by Clement Escoffier zakkak commented on Oct 13, 2025 @franz1981 it looks related to #39907
2025-10-13 09:38:06,012 DEBUG [io.net.uti.int.PlatformDependent0] (Thread-0) java.nio.Bits.unaligned: unavailable, true: java.lang.reflect.InaccessibleObjectException: Unable to make static boolean java.nio.Bits.unaligned() accessible: module java.base does not "opens java.nio" to unnamed module @61a1d181
at java.base@25/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:353)
at java.base@25/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:329)
at java.base@25/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:277)
at java.base@25/java.lang.reflect.Method.checkCanSetAccessible(Method.java:182)
at java.base@25/java.lang.reflect.Method.setAccessible(Method.java:176)
at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:34)
at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:426)
at java.base@25/java.security.AccessController.doPrivileged(AccessController.java:74)
at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:389)
at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:336)
at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:90)
at io.netty.channel.DefaultChannelId.defaultProcessId(DefaultChannelId.java:182)
at io.netty.channel.DefaultChannelId.<clinit>(DefaultChannelId.java:82)
at io.quarkus.netty.runtime.NettyRecorder$1.run(NettyRecorder.java:28)
at java.base@25/java.lang.Thread.runWith(Thread.java:1487)
at java.base@25/java.lang.Thread.run(Thread.java:1474)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:832)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:808)
Note that this is not AArhc64 specific, it's just the assertion that doesn't trigger on x86-64. Reacted by Clement Escoffier franz1981 commented on Oct 13, 2025 Since there are tons of optimizations I made which relies on correctly detect such we could enable detecting this correctly (I suppose JVM mode has the sane problem, am I right @zakkak ?) and I can implement via VarHandle some of these (we need to check native image got it right too), WDYT? franz1981 commented on Oct 13, 2025 franz1981 commented on Oct 13, 2025 franz1981 commented on Oct 13, 2025 zakkak commented on Oct 15, 2025
I suppose JVM mode has the sane problem, am I right @zakkak ?
No, when using JDK 25 I am seeing:
2025-10-15 10:41:04,730 DEBUG [io.net.uti.int.PlatformDependent0] (Thread-1) java.nio.Bits.unaligned: available, true
This is probably related #39907 as well (@zakkak ?)
Correct, see #50469 (comment) Reacted by Francesco Nigro franz1981 commented on Oct 15, 2025
No, when using JDK 25 I am seeing:
Which means that Hotspot is fine, just native image is not able to do it.
I can still improve what we got in Netty without knowing that information, but I would prefer it to be available to native image: what can we do there to make it available? zakkak commented on Oct 15, 2025 Reacted by Francesco Nigro zakkak commented on Dec 10, 2025 zakkak commented on Dec 15, 2025
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|