xGinko / AnarchyExploitFixes

Fix exploits on anarchy Minecraft servers
GNU General Public License v3.0
303 stars 55 forks source link

StackOverFlow Error #89

Closed Toshimichi0915 closed 2 years ago

Toshimichi0915 commented 2 years ago
Caused by: java.lang.StackOverflowError
        at java.lang.AbstractStringBuilder.append(Unknown Source) ~[?:?]
        at java.lang.StringBuilder.append(Unknown Source) ~[?:?]
        at org.apache.logging.log4j.message.ReusableSimpleMessage.formatTo(ReusableSimpleMessage.java:61) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.core.async.RingBufferLogEvent.setMessage(RingBufferLogEvent.java:125) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.core.async.RingBufferLogEvent.setValues(RingBufferLogEvent.java:106) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.core.async.RingBufferLogEventTranslator.translateTo(RingBufferLogEventTranslator.java:58) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.core.async.RingBufferLogEventTranslator.translateTo(RingBufferLogEventTranslator.java:35) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at com.lmax.disruptor.RingBuffer.translateAndPublish(RingBuffer.java:962) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at com.lmax.disruptor.RingBuffer.tryPublishEvent(RingBuffer.java:478) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.core.async.AsyncLoggerDisruptor.tryPublish(AsyncLoggerDisruptor.java:205) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.core.async.AsyncLogger.publish(AsyncLogger.java:166) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.core.async.AsyncLogger.logWithThreadLocalTranslator(AsyncLogger.java:162) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.core.async.AsyncLogger.logMessage(AsyncLogger.java:132) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2091) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1988) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1960) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:733) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.ForwardLogHandler.publish(ForwardLogHandler.java:33) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at java.util.logging.Logger.log(Unknown Source) ~[?:?]
        at java.util.logging.Logger.doLog(Unknown Source) ~[?:?]
        at java.util.logging.Logger.log(Unknown Source) ~[?:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:530) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.Chunk.loadNearby(Chunk.java:1103) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:59) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:17) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:337) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:295) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.lambda$syncChunkLoad$0(ChunkIOExecutor.java:18) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.MCUtil.ensureMain(MCUtil.java:69) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:18) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:171) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:154) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:150) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.getType(World.java:897) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.a(World.java:592) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.applyPhysics(World.java:555) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.update(World.java:505) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.notifyAndUpdatePhysics(World.java:457) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.setTypeAndData(World.java:441) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setTypeIdAndData(CraftBlock.java:145) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setTypeId(CraftBlock.java:132) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setType(CraftBlock.java:123) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setType(CraftBlock.java:118) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at me.moomoo.anarchyexploitfixes.prevention.Bedrock.onChunkLoadEvent(Bedrock.java:31) ~[?:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:35) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.Chunk.loadNearby(Chunk.java:1103) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:59) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:17) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:337) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:295) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.lambda$syncChunkLoad$0(ChunkIOExecutor.java:18) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.MCUtil.ensureMain(MCUtil.java:69) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:18) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:171) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:154) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:150) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.getType(World.java:897) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.a(World.java:592) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.applyPhysics(World.java:555) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.update(World.java:505) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.notifyAndUpdatePhysics(World.java:457) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.setTypeAndData(World.java:441) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setTypeIdAndData(CraftBlock.java:145) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setTypeId(CraftBlock.java:132) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setType(CraftBlock.java:123) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setType(CraftBlock.java:118) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        <This continues forever...>
        at me.moomoo.anarchyexploitfixes.prevention.Bedrock.onChunkLoadEvent(Bedrock.java:31) ~[?:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:35) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.Chunk.loadNearby(Chunk.java:1103) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:59) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:17) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:337) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:295) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.lambda$syncChunkLoad$0(ChunkIOExecutor.java:18) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.MCUtil.ensureMain(MCUtil.java:69) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:18) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:171) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:154) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:150) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.getType(World.java:897) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.a(World.java:592) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.applyPhysics(World.java:550) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.update(World.java:505) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.notifyAndUpdatePhysics(World.java:457) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.setTypeAndData(World.java:441) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setTypeIdAndData(CraftBlock.java:145) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setTypeId(CraftBlock.java:132) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setType(CraftBlock.java:123) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock.setType(CraftBlock.java:118) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at me.moomoo.anarchyexploitfixes.prevention.Bedrock.onChunkLoadEvent(Bedrock.java:31) ~[?:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:35) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.Chunk.loadNearby(Chunk.java:1103) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:59) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOProvider.callStage2(ChunkIOProvider.java:17) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:337) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.util.AsynchronousExecutor.getSkipQueue(AsynchronousExecutor.java:295) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.lambda$syncChunkLoad$0(ChunkIOExecutor.java:18) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.MCUtil.ensureMain(MCUtil.java:69) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at org.bukkit.craftbukkit.v1_12_R1.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:18) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:171) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:154) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:150) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.getType(World.java:897) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.a(World.java:592) ~[patched_1.12.2.jar:git-Paper-"e591764"]
        at net.minecraft.server.v1_12_R1.World.applyPhysics(World.java:550) ~[patched_1.12.2.jar:git-Paper-"e591764"]

Plugins: Dynmap, ProtocolLib, AnarchyExploitFixes Additional Context: I used this map which can be downloaded from this website

moom0o commented 2 years ago

this doesn't seem like an anarchyexploitfixes problem

Toshimichi0915 commented 2 years ago
    at me.moomoo.anarchyexploitfixes.prevention.Bedrock.onChunkLoadEvent(Bedrock.java:31) ~[?:?]
Toshimichi0915 commented 2 years ago

It seems that c.getBlock(x, y, z).setType(Material.BEDROCK); is causing infinite chunk loading loop

Toshimichi0915 commented 2 years ago

image According to Javadoc x and z has to be 0-16, not world coordinates. That's probably the cause of this error

Toshimichi0915 commented 2 years ago

image Also isn't FillInBedrockRoof completely broken?

Toshimichi0915 commented 2 years ago

y has to be y127 or smth

moom0o commented 2 years ago

There hasn't really been a problem on 1.12.

Toshimichi0915 commented 2 years ago

But I have experienced a problem and according to javadoc the code has to be wrong, right?

Toshimichi0915 commented 2 years ago

I found why this code caused StackOverFlow.

Some parts of the map I downloaded were entirely void, and thus old Bedrock.java filled the entire floor of the loaded chunks with bedrock. And because your code does not prevent physics when placing a bedrock, block update occurs in neighbour chunks, which causes infinite loops.

moom0o commented 2 years ago

Well yeah this plugin is meant for anarchy servers where the ground is all bedrock, so incase bedrock is broken with an exploit it will be replaced.

Toshimichi0915 commented 2 years ago

I understand that. But it's better not to affect neighbor blocks for performance/other reasons. Also my code is a lot cleaner.

moom0o commented 2 years ago

Fixed in https://github.com/moom0o/AnarchyExploitFixes/releases/tag/1.27.0