Periodic disconnect with ConcurrentModificationException
miguetdev opened this issue · 14 comments
Multiple users on our server have been reporting random disconnects with ConcurrentModificationException, I can view these events in console.
Mod Version: 0.4.0
[24.02 16:41:10] [Server] java.util.ConcurrentModificationExceptionnull
[24.02 16:41:10] [Server] at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445) ~[?:1.8.0_{}
[24.02 16:41:10] [Server] at java.util.HashMap$KeyIterator.next(HashMap.java:1469) ~[?:1.8.0_{}
[24.02 16:41:10] [Server] at net.minecraft.nbt.CompoundNBT.func_74734_a(CompoundNBT.java:82) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:randompatches.mixins.json:CompoundNBTMixin,pl:mixin:A}
[24.02 16:41:10] [Server] at net.minecraft.nbt.CompressedStreamTools.func_150663_a(CompressedStreamTools.java:103) ~[?:?] {re:classloading}
[24.02 16:41:10] [Server] at net.minecraft.nbt.CompressedStreamTools.func_74800_a(CompressedStreamTools.java:96) ~[?:?] {re:classloading}
[24.02 16:41:10] [Server] at net.minecraft.network.PacketBuffer.func_150786_a(PacketBuffer.java:258) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:randompatches.mixins.json:packetsizelimits.PacketBufferMixin,pl:mixin:A,pl:runtimedistcleaner:A}
[24.02 16:41:10] [Server] at net.minecraft.network.PacketBuffer.writeItemStack(PacketBuffer.java:316) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:randompatches.mixins.json:packetsizelimits.PacketBufferMixin,pl:mixin:A,pl:runtimedistcleaner:A}
[24.02 16:41:10] [Server] at net.minecraft.network.PacketBuffer.func_150788_a(PacketBuffer.java:295) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:randompatches.mixins.json:packetsizelimits.PacketBufferMixin,pl:mixin:A,pl:runtimedistcleaner:A}
[24.02 16:41:10] [Server] at net.minecraft.network.play.server.SEntityEquipmentPacket.func_148840_b(SourceFile:54) ~[?:?] {re:classloading}
[24.02 16:41:10] [Server] at net.minecraft.network.NettyPacketEncoder.encode(NettyPacketEncoder.java:38) ~[?:?] {re:classloading}
[24.02 16:41:10] [Server] at net.minecraft.network.NettyPacketEncoder.encode(NettyPacketEncoder.java:12) ~[?:?] {re:classloading}
[24.02 16:41:10] [Server] at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1071) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:300) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at net.minecraft.network.NetworkManager.lambda$dispatchPacket$5(NetworkManager.java:196) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:runtimedistcleaner:A}
[24.02 16:41:10] [Server] at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) [server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:313) [server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [server-1.16.5-20210115.111550-extra.jar:?] {}
[24.02 16:41:10] [Server] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_{}
[24.02 16:41:10] [Disconnect] Vezdekhod has disconnected, reasonInternal Exception: io.netty.handler.codec.EncoderException: java.util.ConcurrentModificationException
Thanks for the report, we've been seeing it too. No idea what's causing it yet sadly.
For now the only "solution" is to turn the difficulty to peaceful to prevent mob spawns.
Will keep that in mind, hope it can get tracked down soon. If there's any other info I can try to grab let me know.
That crash is unfortunately unrelated to the disconnect issue (it was just you pressing the ultimine key before loading into the world 😄). Will hopefully be fixed, but yeah not related.
I don't know if it helps, but I had it occur to myself just a second ago but it caused a full client crash this time. Here's the crash log: https://pastebin.com/c59HnAJT
First time I was able to rejoin the server just fine, second time it almost instantly disconnected and then crashed the client
PastebinPastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Weird. Before the crash I was fully in the world, and right as ultimine was used I received the crash, so I thought it might be related since our early speculation was it being a spawn related crash, thought maybe it was near where I was. :P Good to know on ultimine, I'll give it a couple of minutes into loading before using it on a join!
Glad to see comments continuing even if we're still in a mystery! Thanks for continuing to look into this, we love the pack.
That actually seems like a likely possibility that was the cause of CME.
The modification of the nbt on the stack itself was an accident it was only supposed to add a few ints to the compound that's sent to client, but by accident it actually modified the original nbt as well.
Anyway this is solved in the latest version on CF as there's no need to send special nbt to client anymore and this code was removed there.
(For reference purposes, the full log can be downloaded here: https://gist.github.com/Halfdeaf/7b56b72680f2539271ec2d69e944cfac)
This issue is confirmed to have been caused by Sophisticated Backpacks (cc @P3pp3rF1y) trying to edit a CompoundTag while it was being written to a packet, see the shortened log here:
[26Feb2021 01:40:01.899] [Netty Server IO #4/ERROR] [ky.someone.debugit.DebugIt/]: help!!!
java.lang.RuntimeException: Modifying compound tag while writing to buffer!
at net.minecraft.nbt.CompoundNBT.handler$zfo000$putInt(CompoundNBT.java:1106) ~[?:?]
at net.minecraft.nbt.CompoundNBT.func_74768_a(CompoundNBT.java) ~[?:?]
at net.p3pp3rf1y.sophisticatedbackpacks.backpack.wrapper.BackpackWrapper.getClientTag(BackpackWrapper.java:131) ~[sophisticatedbackpacks:1.16.4-2.2.0.171]
at net.minecraftforge.common.util.LazyOptional.map(LazyOptional.java:210) ~[forge:?]
at net.p3pp3rf1y.sophisticatedbackpacks.backpack.BackpackItem.getShareTag(BackpackItem.java:278) ~[sophisticatedbackpacks:1.16.4-2.2.0.171]
at net.minecraftforge.common.extensions.IForgeItemStack.getShareTag(IForgeItemStack.java:374) ~[forge:?]
at net.minecraft.network.PacketBuffer.writeItemStack(PacketBuffer.java:313) ~[?:?]
at net.minecraft.network.PacketBuffer.func_150788_a(PacketBuffer.java:295) ~[?:?]
at net.minecraft.network.play.server.SEntityEquipmentPacket.func_148840_b(SourceFile:54) ~[?:?]
(The debug mixin is only active while write
is being executed)
CME disconnect E6. GitHub Gist: instantly share code, notes, and snippets.