SpongeForge icon indicating copy to clipboard operation
SpongeForge copied to clipboard

[1.12.2] Infinite loop caused by incorrect blockstate

Open GuusLieben opened this issue 4 years ago • 5 comments

I am currently running

  • SpongeForge version: 1.12.2-2838-7.2.1-RC4011

  • Forge version: 14.23.5.2847

  • Java version: 1.8.0_252 64bit AdoptOpenJDK

  • Operating System: Linux amd64

  • Plugins/Mods: https://gist.github.com/GuusLieben/9afc079fc50139df24e5187f543b7a49

Issue Description Whenever a block with incorrect block data, like minecraft:snow_layer[layers=8] appears in the world, an infinite loop occurs between net.minecraft.world.WorldServer.func_180501_a(WorldServer.java:4517) and org.spongepowered.common.event.tracking.PhaseTracker.setBlockState(PhaseTracker.java:968 occurs. Which in turn causes the server to either hit a stackoverflow, or the ServerHangWatchdog to close the server after a single tick takes more than the max allowed tick time.

Additional information about func_180501_a : MC 1.12: net/minecraft/world/World.setBlockState Name: a => func_180501_a => setBlockState Comment: "Flag 1 will cause a block update. Flag 2 will send the change to clients. Flag 4 will prevent the block from being re-rendered, if this is a client world. Flag 8 will force any re-renders to run on the main thread instead of the worker pool, if this is a client world and flag 4 is clear. Flag 16 will prevent observers from seeing this change. Flags can be OR-ed" Side: BOTH AT: public net.minecraft.world.World func_180501_a(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;I)Z # setBlockState

  • Crash report : https://gist.github.com/GuusLieben/cc2bbebcdfde6fce9f0e6eba168ab28e

GuusLieben avatar May 13 '20 13:05 GuusLieben

Any progress on this? In the past 2 weeks (14 days) this has caused my server to go down 9 times already.

GuusLieben avatar May 21 '20 14:05 GuusLieben

Here's a better question: How do you get a blockstate with incorrect data? The block states are constructed in near exact limitations within themselves, so I don't understand where the layers=8 comes from.

Any progress on this?

Clearly since no one else has commented, it's just lower on the priority list of everyone's already-limited time. Remember this is a volunteer project, so we can only volunteer time that is available, sometimes some issues can take longer because of order of priority.

gabizou avatar May 21 '20 20:05 gabizou

My apologies if my earlier comment came across as a complaint, this was by no means the intent. I was worried my issue got lost as I received no response for about a week.

To answer your question, the incorrect data is usually created by a modified block being placed by other plugins. In my use-case this is usually WorldEdit, however this may differ per server if e.g. multiblock structures are generated by plugins.

To add to my original report, it seems this issue only occurs on vanilla block types. Modded blocks with incorrect data are either rendered invisible, or reset to the default block data. So far I've only encountered the issue with snow layers and powered repeaters.

Finally, I much appreciate the work you guys perform on Sponge. Without it my server wouldn't exist the way it does today, so again my apologies if I came across in a rude or complaining manner 😉

GuusLieben avatar May 22 '20 07:05 GuusLieben

@clienthax can you look into this?

Zidane avatar Aug 30 '20 17:08 Zidane

@clienthax can you look into this?

I wouldn't know where to start tbh, But i would expect vanilla to also crash if a blockstate was outright invalid

clienthax avatar Aug 30 '20 19:08 clienthax