Storage Drawers

Storage Drawers

151M Downloads

Client Disconnect

dewboy3d opened this issue ยท 8 comments

commented

Upon loading the world, the client disconnects with the following error..

Connection Lost
A fatal error has occurred, this connection is terminated

This is the relevant part of the FTB log

[18:01:53] [Client thread/ERROR] [FML]: FMLIndexedMessageCodec exception caught
io.netty.handler.codec.DecoderException: java.lang.NegativeArraySizeException
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?]
    at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.internal.FMLProxyPacket.func_148833_a(FMLProxyPacket.java:77) [FMLProxyPacket.class:?]
    at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212) [ej.class:?]
    at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273) [bje.class:?]
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1590) [bao.class:?]
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:961) [bao.class:?]
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887) [bao.class:?]
    at net.minecraft.client.main.Main.main(SourceFile:148) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
Caused by: java.lang.NegativeArraySizeException
    at com.jaquadro.minecraft.storagedrawers.network.ControllerUpdateMessage.fromBytes(ControllerUpdateMessage.java:40) ~[ControllerUpdateMessage.class:?]
    at cpw.mods.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:17) ~[SimpleIndexedCodec.class:?]
    at cpw.mods.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:7) ~[SimpleIndexedCodec.class:?]
    at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:77) ~[FMLIndexedMessageToMessageCodec.class:?]
    at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:17) ~[FMLIndexedMessageToMessageCodec.class:?]
    at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?]
    ... 18 more

This is on a server running the Regrowth modpack. Others can connect to the server fine and I can conenct to other servers. There is a single Controller block in a loaded chunk in my base.

commented

Can you describe more about the set of drawers the controller is attached to?

commented

How about a screenshot?

2015-04-08_18 53 24

commented

I was able to get tp'd away from my base. Returning to my base was ok and no disconnect. after getting back into the game, I removed the drawer controller and replaced it but it does not work at all now. I haven't yet built another to test.

commented

Well I suppose that if you are getting your array size from the byte buffer, it could contain corrupted data. You may want to check that the data you are getting from the buffer is correct or at the very least a positive integer. I haven't gone through all the code (just the ControllerUpdateMessage.java) so I don't know what data you are expecting in the buffer.

And I wasn't waiting long enough for the controller to recalculate. It is working fine now.

commented

You're correct that one of the likely ways of getting a negative number there is corruption (but how that would happen is a mystery). I can put in some checks anyway.

commented

Very strange. I'm not even sure how that error is possible (a negative array length?). I might need to add logging to get more information.

The controller is supposed to recalculate its drawer network every 5 seconds. That means immediately after you place it, it may not work. But it should be functioning within 5 seconds.

commented

I've added some extra checks in 1.3.7 to guard against this. It will log an error to the console with more detail. Just in case you ever happen to see it.

I've also modified the controller to initialize immediately after placement. In the process I discovered that the controller wasn't reliably finding all drawers within 12 blocks when arranged like your screenshot, so there's been a fix for that too.

commented

Awesome, Thanks.