Create Big Cannons

Create Big Cannons

5M Downloads

ThreadLocalRandom accessed from non-server thread

KaktuszSok opened this issue ยท 1 comments

commented

Upon receiving a fire action packet, the firing of cannons is done on the network thread rather than on the server thread. This causes crashes.

Caught by c2me:

Caused by: java.util.ConcurrentModificationException: ThreadLocalRandom accessed from a different thread (owner: Server thread, current: Netty Server IO #1)
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.handleNotOwner(CheckedThreadLocalRandom.java:55) ~[c2me-fixes-worldgen-threading-is+alpha.9.11-fd14208c8c793a1d.jar:?]
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.isSafe(CheckedThreadLocalRandom.java:38) ~[c2me-fixes-worldgen-threading-is+alpha.9.11-fd14208c8c793a1d.jar:?]
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.method_43156(CheckedThreadLocalRandom.java:86) ~[c2me-fixes-worldgen-threading-is+alpha.9.11-fd14208c8c793a1d.jar:?]
	at net.minecraft.class_6566.method_43058(class_6566.java:61) ~[client-intermediary.jar:?]
	at net.minecraft.class_1542.<init>(net/minecraft/class_1542.java:60) ~[client-intermediary.jar:?]
	at rbasamoyai.createbigcannons.cannon_control.contraption.MountedAutocannonContraption.fireShot(rbasamoyai/createbigcannons/cannon_control/contraption/MountedAutocannonContraption.java:260) ~[createbigcannons-fabric-1.19.2-0.5.2.jar:?]
	at rbasamoyai.createbigcannons.cannon_control.contraption.PitchOrientedContraptionEntity.tryFiringShot(rbasamoyai/createbigcannons/cannon_control/contraption/PitchOrientedContraptionEntity.java:270) ~[createbigcannons-fabric-1.19.2-0.5.2.jar:?]
	at rbasamoyai.createbigcannons.network.ServerboundFiringActionPacket.handle(ServerboundFiringActionPacket.java:23) ~[createbigcannons-fabric-1.19.2-0.5.2.jar:?]
	at rbasamoyai.createbigcannons.fabric.network.FabricPacket.handle(FabricPacket.java:28) ~[createbigcannons-fabric-1.19.2-0.5.2.jar:?]
	at com.simibubi.create.foundation.networking.SimplePacketBase.handle(SimplePacketBase.java:37) ~[create-fabric-0.5.1-c-build.1160+mc1.19.2.jar:?]
	at me.pepperbell.simplenetworking.SimpleChannel$C2SHandler.receive(SimpleChannel.java:249) ~[porting_lib_networking-2.1.1096+1.19.2-be705abbb6f6bd75.jar:?]
	at net.fabricmc.fabric.impl.networking.server.ServerPlayNetworkAddon.receive(ServerPlayNetworkAddon.java:89) ~[fabric-networking-api-v1-1.2.12+def3f86d90-40dbcfca42bb4b90.jar:?]
	at net.fabricmc.fabric.impl.networking.server.ServerPlayNetworkAddon.receive(ServerPlayNetworkAddon.java:38) ~[fabric-networking-api-v1-1.2.12+def3f86d90-40dbcfca42bb4b90.jar:?]
	at net.fabricmc.fabric.impl.networking.AbstractChanneledNetworkAddon.handle(AbstractChanneledNetworkAddon.java:101) ~[fabric-networking-api-v1-1.2.12+def3f86d90-40dbcfca42bb4b90.jar:?]
	at net.fabricmc.fabric.impl.networking.server.ServerPlayNetworkAddon.handle(ServerPlayNetworkAddon.java:84) ~[fabric-networking-api-v1-1.2.12+def3f86d90-40dbcfca42bb4b90.jar:?]
	at net.minecraft.class_3244.handler$cjo000$fabric-networking-api-v1$handleCustomPayloadReceivedAsync(net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java [fabric-networking-api-v1.mixins.json]:61) ~[client-intermediary.jar:?]
	at net.minecraft.class_3244.method_12075(class_3244.java) ~[client-intermediary.jar:?]
	at net.minecraft.class_2817.method_12199(net/minecraft/class_2817.java:38) ~[client-intermediary.jar:?]
	at net.minecraft.class_2817.method_11054(net/minecraft/class_2817.java:7) ~[client-intermediary.jar:?]
	at net.minecraft.class_2535.method_10759(net/minecraft/class_2535.java:167) ~[client-intermediary.jar:?]
	at net.minecraft.class_2535.method_10770(net/minecraft/class_2535.java:152) ~[client-intermediary.jar:?]
	at net.minecraft.class_2535.channelRead0(net/minecraft/class_2535.java:50) ~[client-intermediary.jar:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.local.LocalChannel.readInbound(LocalChannel.java:299) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.local.LocalChannel.finishPeerRead0(LocalChannel.java:445) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:50) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:403) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) [netty-common-4.1.77.Final.jar:?]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) [netty-common-4.1.77.Final.jar:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) [netty-common-4.1.77.Final.jar:?]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503) [netty-transport-4.1.77.Final.jar:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) [netty-common-4.1.77.Final.jar:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.77.Final.jar:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
commented

Could you provide the full crash report? I would like to know the mod list and platform you were using.