PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

(Guard) Drone became random user kicking machine when placing

MPThLee opened this issue ยท 4 comments

commented

Minecraft Version

1.16.5

Forge Version

36.2.22

Mod Version

1.16.5-2.14.7-283
(On modpack, all the mods 6 v1.18.17)

Describe your problem, including steps to reproduce it

It's still mysterious issue. When I (on localhost) placing a Guard Drone with some upgrade, Other user kicked randomly. but not myself.
On server log, it says error encoding packet.

Also, I think this problem may still present recent version too. as there's no code change on drone/ItemPressurizable in recent version.

Any other comments?

Server side log:

[20:03:57] [Server thread/INFO] [minecraft/ServerPlayNetHandler]: [User] lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.util.ConcurrentModificationException
[20:03:57] [Server thread/INFO] [minecraft/DedicatedServer]: [User] left the game
[20:03:58] [Netty Server IO #19/ERROR] [minecraft/NettyPacketEncoder]: Error encoding packet
java.util.ConcurrentModificationException: null
        at java.util.HashMap$HashIterator.nextNode(HashMap.java:1511) ~[?:?] {}
        at java.util.HashMap$EntryIterator.next(HashMap.java:1544) ~[?:?] {}
        at java.util.HashMap$EntryIterator.next(HashMap.java:1542) ~[?:?] {}
        at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at java.util.HashMap.putMapEntries(HashMap.java:508) ~[?:?] {}
        at java.util.HashMap.<init>(HashMap.java:486) ~[?:?] {}
        at com.google.common.collect.Maps.newHashMap(Maps.java:333) ~[server-1.16.5-20210115.111550-extra.jar:?] {re:mixin}
        at net.minecraft.nbt.CompoundNBT.func_74737_b(CompoundNBT.java:388) ~[?:?] {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:APP:rhino-common.mixins.json:CompoundTagMixin,pl:mixin:A}
        at me.desht.pneumaticcraft.common.item.ItemPressurizable.roundedPressure(ItemPressurizable.java:154) ~[pneumaticcraft:1.16.5-2.14.7-283] {re:classloading}
        at me.desht.pneumaticcraft.common.item.ItemPressurizable.getShareTag(ItemPressurizable.java:111) ~[pneumaticcraft:1.16.5-2.14.7-283] {re:classloading}
        at net.minecraftforge.common.extensions.IForgeItemStack.getShareTag(IForgeItemStack.java:376) ~[forge:?] {re:mixin,re:computing_frames,re:classloading,pl:mixin:APP:apotheosis.mixins.json:MixinIForgeItemStack,pl:mixin:APP:mana_and_artifice.mixins.json:PiglinGoldMixin,pl:mixin:A}
        at net.minecraft.network.PacketBuffer.writeItemStack(PacketBuffer.java:308) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:randompatches.mixins.json:packetsizelimits.PacketBufferMixin,pl:mixin:A}
        at net.minecraft.network.PacketBuffer.func_150788_a(PacketBuffer.java:290) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:randompatches.mixins.json:packetsizelimits.PacketBufferMixin,pl:mixin:A}
        at net.minecraft.network.play.server.SEntityEquipmentPacket.func_148840_b(SourceFile:54) ~[?:?] {re:classloading}
        at net.minecraft.network.NettyPacketEncoder.encode(NettyPacketEncoder.java:38) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:connectivity.mixins.json:networkstats.NettyPacketEncoderMixin,pl:mixin:A}
        at net.minecraft.network.NettyPacketEncoder.encode(NettyPacketEncoder.java:12) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:connectivity.mixins.json:networkstats.NettyPacketEncoderMixin,pl:mixin:A}
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[server-1.16.5-20210115.111550-extra.jar:?] {re:mixin}
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:111) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1071) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:300) ~[server-1.16.5-20210115.111550-extra.jar:?] {}
        at net.minecraft.network.NetworkManager.lambda$sendPacket$5(NetworkManager.java:196) ~[?:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:runtimedistcleaner:A}
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) [server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:465) [server-1.16.5-20210115.111550-extra.jar:?] {}
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [server-1.16.5-20210115.111550-extra.jar:?] {}
        at java.lang.Thread.run(Thread.java:829) [?:?] {}
commented

I think I can see what's happening here - the NBT copy (CompoundNBT.func_74737_b) initializes a new hash map based on the hashmap in the item's existing tag, but from a different thread, which is causing the CME - the original hashmap is probably already being iterated. Going to try an alternative approach.

commented

May be difficult for you to test since it's on a server (and updating to 2.15 brings all the texture changes), but build 301 from https://jenkins.k-4u.nl/job/PneumaticCraft-Repressurized-1.16/ might fix this. If you can test that would be great. Change will be in the next release anyway (2.15.2).

commented

I think this doesn't happened on localhost (using second account). seems latency delay and async issue. I will test new version in a week(hopefully if can. i'm bit busy too.) as server is currently bit idle.

commented

Hopefully fixed in 2.15.2 release (hard to know for sure since I can't reproduce). Feel free to reopen this is if it re-occurs with 2.15.2.