williewillus / botania-fabric-issues

Temporary home for bug reports of Botania fabric alpha testing
1 stars 0 forks source link

Server deadlock when using corporea index immediately after logging in or something idk it's weird #33

Closed quat1024 closed 3 years ago

quat1024 commented 3 years ago

using 410-fabric-snapshot.jar in #betas

Looks like calling ServerChunkManager#getChunk from a packet handler explodes. In Forge this probably used an event that got executed on the main thread wait it still needs to cancel

Complete stacktrace: https://paste.ee/p/kXq2g

Stacktrace of the server thread:

"Server thread@18302" prio=5 tid=0x43 nid=NA waiting
  java.lang.Thread.State: WAITING
      at sun.misc.Unsafe.park(Unsafe.java:-1)
      at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
      at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1693)
      at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
      at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1729)
      at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1934)
      at net.minecraft.server.world.ServerChunkManager.getChunk(ServerChunkManager.java:113)
      at net.minecraft.world.chunk.ChunkManager.getWorldChunk(ChunkManager.java:14)
      at net.minecraft.world.World.getEntitiesByClass(World.java:720)
      at vazkii.botania.common.impl.corporea.CorporeaHelperImpl.getSparkForBlock(CorporeaHelperImpl.java:144)
      at vazkii.botania.common.block.tile.corporea.TileCorporeaBase.getSpark(TileCorporeaBase.java:24)
      at vazkii.botania.common.block.tile.corporea.TileCorporeaIndex$InputHandler.onChatMessage(TileCorporeaIndex.java:376)
      at net.minecraft.server.network.ServerPlayNetworkHandler.handler$zkc000$handleCorporeaRequest(MixinServerPlayNetworkHandler.java:26)
      at net.minecraft.server.network.ServerPlayNetworkHandler.onGameMessage(ServerPlayNetworkHandler.java:1035)
      at net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket.apply(ChatMessageC2SPacket.java:31)
      at net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket.apply(ChatMessageC2SPacket.java:12)
      at net.minecraft.network.NetworkThreadUtils.method_11072(NetworkThreadUtils.java:20)
      at net.minecraft.network.NetworkThreadUtils$$Lambda$5742.551374760.run(Unknown Source:-1)
      at net.minecraft.server.ServerTask.run(ServerTask.java:17)
      at net.minecraft.util.thread.ThreadExecutor.executeTask(ThreadExecutor.java:136)
      at net.minecraft.util.thread.ReentrantThreadExecutor.executeTask(ReentrantThreadExecutor.java:22)
      at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:749)
      at net.minecraft.server.MinecraftServer.executeTask(MinecraftServer.java:1724)
      at net.minecraft.util.thread.ThreadExecutor.runTask(ThreadExecutor.java:109)
      at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:729)
      at net.minecraft.server.MinecraftServer.runTask(MinecraftServer.java:723)
      at net.minecraft.util.thread.ThreadExecutor.runTasks(ThreadExecutor.java:119)
      at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:709)
      at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:663)
      at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:224)
      at net.minecraft.server.MinecraftServer$$Lambda$5282.1403924920.run(Unknown Source:-1)
      at java.lang.Thread.run(Thread.java:748)
quat1024 commented 3 years ago

I have a way better time reproing this when I activate the corporea index immediately after loading into the world, btw (Dunno how long the window is but maybe 2-3 seconds)

quat1024 commented 3 years ago

I think you actually have to relog, as well. like if you do it first thing after opening the game, it will not deadlock. you need to open the world, close the world, open it again and immediately send a chat message, then the game hangs.

i think

Hubry commented 3 years ago

Reproduced on Forge, doing basically the exact same things by accident. Amazing.