SpongePowered / Sponge

The SpongeAPI implementation targeting vanilla Minecraft and 3rd party platforms.
MIT License
393 stars 211 forks source link

[1.10.2] Server crash, caused by Chunk Generator/Loader #912

Closed Pymous closed 8 years ago

Pymous commented 8 years ago

Hey !

It's me again :D

Since a few days now, we've been "randomly crashing", after a while we figured out that when one specific player was connecting. I teleported him back at spawn, and tried to teleport to the coordinates myself, and bam, crash.

Unable to find the corrupted chunk, we called it a day, but now, ANOTHER player found the same (or another) corrupted regions, and everytime this player join, the server crash.

I'm a bit stuck on this one ... hope you guys can do something about it, I have a "few" logs :D

crash-2016-08-31_15.41.45-server.txt crash-2016-08-31_15.45.25-server.txt crash-2016-08-31_16.28.37-server.txt crash-2016-08-31_16.29.56-server.txt crash-2016-08-31_16.32.13-server.txt crash-2016-08-31_16.43.59-server.txt crash-2016-08-31_16.47.17-server.txt crash-2016-08-31_16.50.39-server.txt crash-2016-08-31_17.00.50-server.txt crash-2016-08-31_17.15.39-server.txt crash-2016-08-31_13.02.04-server.txt crash-2016-08-31_13.03.49-server.txt crash-2016-08-31_13.05.16-server.txt crash-2016-08-31_13.10.52-server.txt crash-2016-08-31_13.22.19-server.txt crash-2016-08-31_13.29.32-server.txt crash-2016-08-31_14.14.51-server.txt crash-2016-08-31_14.19.51-server.txt crash-2016-08-31_14.45.28-server.txt crash-2016-08-31_15.09.00-server.txt crash-2016-08-31_15.10.51-server.txt crash-2016-08-31_15.13.31-server.txt crash-2016-08-31_15.14.52-server.txt crash-2016-08-31_15.16.01-server.txt crash-2016-08-31_15.17.20-server.txt crash-2016-08-31_15.21.47-server.txt crash-2016-08-31_15.23.59-server.txt crash-2016-08-31_15.27.24-server.txt crash-2016-08-31_15.35.32-server.txt crash-2016-08-31_15.36.45-server.txt crash-2016-08-31_15.38.17-server.txt

Thanks for your awesome work !

JBYoshi commented 8 years ago

For the developers, here's a (shortened) stack trace with the fully deobfuscated names:

java.lang.StackOverflowError: Exception ticking world
    at net.minecraft.world.gen.ChunkProviderServer.canDenyChunkRequest(ChunkProviderServer.java:175)
    at net.minecraft.world.gen.ChunkProviderServer.redirect$onProvideChunkHead$0(ChunkProviderServer.java:143)
    at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:132)
    at net.minecraft.world.World.getChunkFromChunkCoords(World.java:303)
    at net.minecraft.world.World.getChunkFromBlockCoords(World.java:298)
    at org.spongepowered.common.event.tracking.CauseTracker.setBlockState(CauseTracker.java:335)
// START REPEAT
    at net.minecraft.world.WorldServer.setBlockState(WorldServer.java:1032)
    at net.minecraft.block.BlockChest.checkForSurroundingChests(BlockChest.java:237)
    at net.minecraft.block.BlockChest.onBlockAdded(BlockChest.java:74)
    at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:630)
    at net.minecraft.world.chunk.Chunk.setBlockState(Chunk.java:500)
    at org.spongepowered.common.event.tracking.CauseTracker.setBlockState(CauseTracker.java:381)
// END REPEAT, Java doesn't give anything beyond this

Here's what I think the problem is:

(I assume this is where the problem happens)

And so on until the server gives up and crashes.

gabizou commented 8 years ago

@JBYoshi Thank you so much for looking into it and providing a very detailed response as to what is going on. I'm curious though since the current method

    at net.minecraft.world.gen.ChunkProviderServer.canDenyChunkRequest(ChunkProviderServer.java:175)

is commented out whether this build that is having this issue is one of the few test builds that @bloodmc has been pushing out with his changes, at which point this is still a potential thing to look into, if not re-test on whatever the latest test build is.

Pymous commented 8 years ago

@gabizou : We're using the latest build blood gave on IRC (so it's probably even ahead from the git for a few things), but the first time this happened, we were on Build 1689.

@JBYoshi : Thanks for the work, blood kinda got the same thinking as far as I can understand :)

To help, here is the map we have, and the coordinates were the issue happen : Map => http://mc.clapity.eu/blood.zip Coordinates => /tppos 13531 44 12581 -f

You will need Pixelmon 5 (Beta 6) to load the map properly :)

ryantheleach commented 8 years ago

@JBYoshi Did you deobfuscate the stack trace manually? or is there some tool that can do it?

JBYoshi commented 8 years ago

@ryantheleach Manually. If you want to do it, the necessary file is in ~/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_<either release or snapshot>/<mappings version>/srgs/srg-mcp.srg.

theboomer commented 8 years ago

I know that Pymous wasn't able to identify the exact chunk with error and blood hasn't been able to replicate, but based on JBYoshi's info, would it be most likely that you'd be looking for a chest that is on a chunk-boundary, loading one half of a doublechest in one chunk, doing a look around while the other half in in a different chunk... somehow to try checking the nbt data in surrounding chunks around his coordinate given to find a chest tile on an x or z coordinate that is exactly at a boundary line or setting up a test for exactly-on-boundary line and approaching that region from different directions with maxed out view radiuses to make the process take longer before the second half happens?

Pymous commented 8 years ago

Well, blood gave me a custom build with more debugging output, and he was able to identify and fix the issue (we're not crashing anymore at least).

I will try to tell him to detail what he did when I see him :)

bloodmc commented 8 years ago

Turns out all those TE crashes were caused by pixelmon. Report to them.

bloodmc commented 8 years ago

Reopening as the issue is actually caused while attempting to generate a structure in an unloaded chunk.