Immersive Engineering

Immersive Engineering

134M Downloads

NPE crash in TileEntityMultiblockPart.isDummy

LemADEC opened this issue · 21 comments

commented

Description of the issue:

When teleporting to a player's base, client is crashing before rendering blocks in the world.

Crashlog:

https://gist.github.com/LemADEC/2b7cccf1956f4d7838991d093e7f2344

java.lang.ArrayIndexOutOfBoundsException: 0
	at blusunrize.immersiveengineering.common.blocks.TileEntityMultiblockPart.isDummy(TileEntityMultiblockPart.java:265)
	at blusunrize.immersiveengineering.common.blocks.metal.TileEntityFermenter.func_73660_a(TileEntityFermenter.java:77)
	at net.minecraft.world.World.func_72939_s(World.java:1832)

Versions & Modlist

FTB Continuum 1.2.1 including ImmersiveEngineering-0.12-82

commented

Can the player in question move around their base normally?

commented

yes, the player also crashes when going there

commented
  • adding optifine doesn't help
  • coming from north, sourth, east or west side, at ~135 m away, with render distance set to 2 chunks will reproduce the issue
commented
  • issue is reproduced in single player with the same map. In that case, I can see a blocks for a very short moment before it crashes
commented

the block itself is reported as a minecraft:efab_rfcontrol according to MCEdit.

Pictures of the setup after deleting the corrupted block:
image
image
image
image

commented

I'd say this is a semi-duplicate of #2973. The only way this can happen is if the TE is missing some or all of its NBT-data, and I suspect the same happened there.

commented

closing this due to no further response

commented

It's a client crash.
What's your question then?

commented

What's your crash report?

commented

Seems the issue only affects client side, since after I added the code that allows client remove the corrupted tileentity in client's world, the machine works properly.

And the issue has gone after replacing it, really weird.

commented

I met this question too... Server side is sponge, maybe the TE is null then, why not just add a try catch to prevent client crash then we can remove the block?

commented

What code are you referring to?

commented

TileEntityMultiblockPart::isDummy

commented

Maybe I got the problem.

My server has sponge installed, and an optimization featured asynchronized light update is enabled by default, which would call Block::getLightValue. In IE's BlockIETileProvider class this method would cause a chunk load, which will cause an async chunk load, and this action will be caught by sponge, maybe then cause the TE corrupt.

Here's some log:

[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*********************************************************************************************************************/
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*                                             Illegal Async Chunk Load                                              */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*********************************************************************************************************************/
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* Sponge relies on knowing when chunks are being loaded as chunks add entities to                                   */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* the parented world for management. These operations are generally not threadsafe                                  */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* and shouldn't be considered a "Sponge bug ". Adding/removing entities from                                        */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* another thread to the world is never ok.                                                                          */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*                                                                                                                   */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*  Chunk Pos : 45, -12                                                                                              */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*                                                                                                                   */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /* java.lang.Exception: Async Chunk Load Detected                                                                    */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.chunk.Chunk.handler$startLoad$zpm000(Chunk.java:6279)                                     */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.chunk.Chunk.func_76631_c(Chunk.java)                                                      */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:109)                      */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94)                      */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:118)                           */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.gen.ChunkProviderServer.func_186028_c(ChunkProviderServer.java:89)                        */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.gen.ChunkProviderServer.redirect$onProvideChunkHead$zmn000(ChunkProviderServer.java:678)  */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.gen.ChunkProviderServer.func_186025_d(ChunkProviderServer.java:135)                       */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.World.func_72964_e(World.java:310)                                                        */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.World.func_175726_f(World.java:305)                                                       */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.World.func_175625_s(World.java:6505)                                                      */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     blusunrize.immersiveengineering.common.blocks.BlockIETileProvider.getLightValue(BlockIETileProvider.java:469) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.block.state.BlockStateContainer$StateImplementation.getLightValue(BlockStateContainer.java:510) */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     org.spongepowered.common.SpongeImplHooks.getChunkPosLight(SpongeImplHooks.java:1521)                          */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.WorldServer.getRawBlockLightAsync(WorldServer.java:5050)                                  */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.WorldServer.checkLightAsync(WorldServer.java:4874)                                        */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.WorldServer.lambda$updateLightAsync$0(WorldServer.java:4990)                              */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     net.minecraft.world.WorldServer$$Lambda$3126.00000000204E40F0.run(Unknown Source)                             */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)                               */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)                               */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*     java.lang.Thread.run(Thread.java:819)                                                                         */
[18:56:45] [Sponge - Async Light Thread/ERROR] [Sponge]: /*********************************************************************************************************************/
commented

That looks like it's the same problem as SpongePowered/SpongeForge#2857, and I agree with the EIO dev(s), this is a Sponge bug, despite the log message.

commented

Async Light be OFF, but... How use setblock ?

commented

Tested on forge server players also crashed with this error
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at blusunrize.immersiveengineering.common.blocks.TileEntityMultiblockPart.isDummy(TileEntityMultiblockPart.java:284) ~[TileEntityMultiblockPart.class:?]
at blusunrize.immersiveengineering.common.blocks.metal.TileEntityArcFurnace.update(TileEntityArcFurnace.java:75) ~[TileEntityArcFurnace.class:?]
at net.minecraft.world.World.redirect$tileEntityUpdate$zbc000(World.java:4132) ~[amu.class:?]
at net.minecraft.world.World.updateEntities(World.java:1835) ~[amu.class:?]

commented

Yeah that's to sponge's fault, as I've given before.

commented

For a quick fix you can use setblock command to delete corrupted blocks, and disable Async Light Optimization in sponge's configuration (global.conf).

commented

/setblock <x> <y> <z> <tileName> [dataValue] [oldBlockHandling] [dataTag]