Server side CME causing player disconnection
LemADEC opened this issue ยท 4 comments
Expected Behavior
Player don't get disconnected from the server.
Current Behavior
A CME is reported, causing the player to get quicked.
Possible Solution
Never access the entity list outside the main thread.
https://github.com/Leviathan-Studio/CraftStudioAPI/blob/master/src/main/java/com/leviathanstudio/craftstudio/common/network/ServerIAnimatedEventMessage.java#L71
Consider using EntityID with world.getEntityByID() instead of its permanent ID: it's smaller (1 int instead of 2 long) and sufficient for an animation (it can reset whenever chunk get saved/reloaded).
Steps to Reproduce
(unknown at this time)
Context
I died and got kicked.
Crash Report
[16:48:53] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: LemADEC was killed by Witch using magic
[16:49:01] [Netty Epoll Server IO #4/ERROR] [FML]: SimpleChannelHandlerWrapper exception
java.util.ConcurrentModificationException: null
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909) ~[?:1.8.0_171]
at java.util.ArrayList$Itr.next(ArrayList.java:859) ~[?:1.8.0_171]
at com.leviathanstudio.craftstudio.common.network.ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.getEntityByUUID(ServerIAnimatedEventMessage.java:71) ~[ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.class:?]
at com.leviathanstudio.craftstudio.common.network.IAnimatedEventMessage$IAnimatedEventHandler.onMessage(IAnimatedEventMessage.java:157) ~[IAnimatedEventMessage$IAnimatedEventHandler.class:?]
at com.leviathanstudio.craftstudio.common.network.ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.onMessage(ServerIAnimatedEventMessage.java:58) ~[ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.class:?]
at com.leviathanstudio.craftstudio.common.network.ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.onMessage(ServerIAnimatedEventMessage.java:53) ~[ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[SimpleChannelHandlerWrapper.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[SimpleChannelHandlerWrapper.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:274) [minecraft_server.1.12.2.jar:?]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:99) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:147) [gw.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:49) [gw.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:453) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:265) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:72) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:1017) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:394) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:299) [minecraft_server.1.12.2.jar:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [minecraft_server.1.12.2.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
[16:49:01] [Netty Epoll Server IO #4/ERROR] [FML]: There was a critical exception handling a packet on channel craftstudioapi
java.util.ConcurrentModificationException: null
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909) ~[?:1.8.0_171]
at java.util.ArrayList$Itr.next(ArrayList.java:859) ~[?:1.8.0_171]
at com.leviathanstudio.craftstudio.common.network.ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.getEntityByUUID(ServerIAnimatedEventMessage.java:71) ~[ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.class:?]
at com.leviathanstudio.craftstudio.common.network.IAnimatedEventMessage$IAnimatedEventHandler.onMessage(IAnimatedEventMessage.java:157) ~[IAnimatedEventMessage$IAnimatedEventHandler.class:?]
at com.leviathanstudio.craftstudio.common.network.ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.onMessage(ServerIAnimatedEventMessage.java:58) ~[ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.class:?]
at com.leviathanstudio.craftstudio.common.network.ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.onMessage(ServerIAnimatedEventMessage.java:53) ~[ServerIAnimatedEventMessage$ServerIAnimatedEventHandler.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[SimpleChannelHandlerWrapper.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[SimpleChannelHandlerWrapper.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) ~[minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) ~[minecraft_server.1.12.2.jar:?]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:274) ~[minecraft_server.1.12.2.jar:?]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:99) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:147) [gw.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:49) [gw.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:453) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:265) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:72) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:1017) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:394) [minecraft_server.1.12.2.jar:?]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:299) [minecraft_server.1.12.2.jar:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [minecraft_server.1.12.2.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
[16:49:01] [Netty Epoll Server IO #4/ERROR] [FML]: Network Disconnect: A fatal error has occurred, this connection is terminated
[16:49:01] [Server thread/INFO] [net.minecraft.network.NetHandlerPlayServer]: LemADEC lost connection: A fatal error has occurred, this connection is terminated
Your Environment
- Version of the api used: CraftStudio-1.0.0.93-mc1.12-alpha.jar
- Version of forge used: 1.12.2-14.23.4.2739
- Link to your project: mobultion-0.4.5.jar / https://github.com/mcpecommander/Mobultion-mod
I working on making the packets thread safe.
An implemented version is available on the maven (repo.leviathan-studio.com) version number : 1.0.1.95-mc1.12-alpha
That should fixe the issue