SpoutDev/Spout — Issue #1452: indexoutofbounds exceptions causing restarts
Author: ray73864
Created: 2012-01-18 06:00:11+00:00
State: open

We have been having issues recently with people using client side inventory mods such as 'Convenient Inventory' where they go to put an item into their hotbar (i'm not sure if it is because of an item that is used by a bukkit plugin or not).

An error occurs in the logfile and then the server immediately restarts.

The error in the logfile is:

2012-01-18 05:35:13 [WARNING] Failed to handle packet: java.lang.IndexOutOfBoundsException: Index: 45, Size: 45
java.lang.IndexOutOfBoundsException: Index: 45, Size: 45
at java.util.ArrayList.rangeCheck(ArrayList.java:604)
at java.util.ArrayList.get(ArrayList.java:382)
at net.minecraft.server.Container.a(Container.java:128)
at org.getspout.spout.SpoutNetServerHandler.handleInventoryClick(SpoutNetServerHandler.java:449)
at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:390)
at net.minecraft.server.Packet102WindowClick.a(SourceFile:28)
at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:93)
at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:550)
at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:527)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)

For an array, there would never be an index #45 because arrays are 0-index based, which means 0 to 44.

Sure enough i could probably post a ticket for every single client mod that could cause this, but that would be a lot more work than catching and throwing the error server side.