Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ArrayIndexOutOfBoundsException

30 views
Skip to first unread message

jelle...@gmail.com

unread,
Oct 3, 2024, 3:18:28 AM10/3/24
to vert.x
Hi all,

While upgrading Vert.x Redis Client from 4.5.9 to 4.5.10, a strange exception appears. A batch request on RedisStandaloneConnection fails to complete or fail the promise because of the following exception.

java.lang.ArrayIndexOutOfBoundsException: arraycopy: last destination index 37 out of bounds for byte[36]

at java.base/java.lang.String.getBytes(String.java:4726)

at java.base/java.lang.AbstractStringBuilder.putStringAt(AbstractStringBuilder.java:1751)

at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:588)

at java.base/java.lang.StringBuilder.append(StringBuilder.java:179)

at io.vertx.redis.client.impl.RedisStandaloneConnection.lambda$doBatch$3(RedisStandaloneConnection.java:311)

at io.vertx.core.impl.future.FutureImpl$4.onFailure(FutureImpl.java:188)

at io.vertx.core.impl.future.FutureBase.lambda$emitFailure$1(FutureBase.java:75)

at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)

at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)

at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)

at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)

at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)

at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)

at java.base/java.lang.Thread.run(Thread.java:1583)


It seems like this exception happens while manipulating the error message of the batch request on https://github.com/vert-x3/vertx-redis-client/blob/92f86cc7f5ed597a2b418ba6ac12ab6ee208d643/src/main/java/io/vertx/redis/client/impl/RedisStandaloneConnection.java#L311

It looks like nothing should be able to go wrong on this line (the connection is being used on the same context with the virtual threading model)

Any ideas?

Ladislav Thon

unread,
Oct 3, 2024, 3:55:55 AM10/3/24
to ve...@googlegroups.com
Hi,

that is indeed a strange exception. It almost looks like a bug in the JDK. What Java version do you use? If you could provide the full output of `java -version`, that would be best IMHO.

Thanks,

LT

čt 3. 10. 2024 v 9:18 odesílatel jelle...@gmail.com <jelle...@gmail.com> napsal:
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/847d88ce-9bf3-4b53-9fd2-fdf0e46dcbc0n%40googlegroups.com.

jelle...@gmail.com

unread,
Oct 3, 2024, 4:35:05 AM10/3/24
to vert.x
That's also what it seemed to be for me, but seems strange that I would be the only one hitting that bug.
openjdk 21.0.4 2024-07-16
OpenJDK Runtime Environment (build 21.0.4+7-Ubuntu-1ubuntu224.04)
OpenJDK 64-Bit Server VM (build 21.0.4+7-Ubuntu-1ubuntu224.04, mixed mode, sharing)

Reply all
Reply to author
Forward
0 new messages