Jump to content

[1.7.10] Concurrent Modification Exception occuring randomly


Recommended Posts

Posted

Anyone know what would cause this here is the error log. I keep getting this exception when running a dedicated server and it happens sometimes during gameplay. I cannot seem to get it to occur on a consistent basis

 

 

[20:31:49] [Netty IO #1/ERROR] [FML]: NetworkDispatcher exception

io.netty.handler.codec.EncoderException: java.util.ConcurrentModificationException

at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:129) ~[MessageToByteEncoder.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:637) ~[DefaultChannelHandlerContext.class:?]

at cpw.mods.fml.common.network.handshake.NetworkDispatcher.write(NetworkDispatcher.java:423) ~[NetworkDispatcher.class:?]

at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:644) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:698) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.writeAndFlush(DefaultChannelHandlerContext.java:688) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelHandlerContext.writeAndFlush(DefaultChannelHandlerContext.java:717) ~[DefaultChannelHandlerContext.class:?]

at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:893) ~[DefaultChannelPipeline.class:?]

at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:239) ~[AbstractChannel.class:?]

at net.minecraft.network.NetworkManager$1.run(NetworkManager.java:197) [NetworkManager$1.class:?]

at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:?]

at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348) [NioEventLoop.class:?]

at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.7.0_25]

Caused by: java.util.ConcurrentModificationException

at java.util.HashMap$HashIterator.nextEntry(Unknown Source) ~[?:1.7.0_25]

at java.util.HashMap$KeyIterator.next(Unknown Source) ~[?:1.7.0_25]

at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:33) ~[NBTTagCompound.class:?]

at net.minecraft.nbt.NBTTagCompound.func_150298_a(NBTTagCompound.java:472) ~[NBTTagCompound.class:?]

at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:35) ~[NBTTagCompound.class:?]

at net.minecraft.nbt.CompressedStreamTools.func_150663_a(CompressedStreamTools.java:158) ~[CompressedStreamTools.class:?]

at net.minecraft.nbt.CompressedStreamTools.write(CompressedStreamTools.java:148) ~[CompressedStreamTools.class:?]

at net.minecraft.nbt.CompressedStreamTools.compress(CompressedStreamTools.java:88) ~[CompressedStreamTools.class:?]

at net.minecraft.network.PacketBuffer.writeNBTTagCompoundToBuffer(PacketBuffer.java:94) ~[PacketBuffer.class:?]

at net.minecraft.network.PacketBuffer.writeItemStackToBuffer(PacketBuffer.java:140) ~[PacketBuffer.class:?]

at net.minecraft.entity.DataWatcher.writeWatchableObjectToPacketBuffer(DataWatcher.java:289) ~[DataWatcher.class:?]

at net.minecraft.entity.DataWatcher.writeWatchedListToPacketBuffer(DataWatcher.java:186) ~[DataWatcher.class:?]

at net.minecraft.network.play.server.S1CPacketEntityMetadata.writePacketData(S1CPacketEntityMetadata.java:50) ~[s1CPacketEntityMetadata.class:?]

at net.minecraft.util.MessageSerializer.encode(MessageSerializer.java:46) ~[MessageSerializer.class:?]

at net.minecraft.util.MessageSerializer.encode(MessageSerializer.java:53) ~[MessageSerializer.class:?]

at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:111) ~[MessageToByteEncoder.class:?]

Posted

CMEs typically occur when dealing with Collections, usually when one thread is iterating over one and another thread is removing items to that same Collection.

 

From your log, it looks as though you have an entity that might be doing some Collections processing when reading/writing NBT, specifically writeWatchedListToPacketBuffer.

 

Putting that section of code within a synchronized block will probably fix it, or by using Iterators to traverse your list when you are removing entries.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.