Crash on Profile Completion
Furgl opened this issue ยท 7 comments
Description:
The mod crashes on profile completion on the server thread in both single-player and multi-player for me. Maybe this is crash is only happening because I'm running in a development environment or something, but it looks like a simple fix.
I excluded a lot of information for brevity.
Stacktrace:
[Server thread/ERROR]: Encountered an unexpected exception
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:418) ~[?:1.8.0_111]
at java.util.ArrayList.get(ArrayList.java:431) ~[?:1.8.0_111]
at cf.terminator.laggoggles.profiler.ProfileResult.createPackets(ProfileResult.java:190) ~[ProfileResult.class:?]
at cf.terminator.laggoggles.CommonProxy$1.run(CommonProxy.java:77) ~[CommonProxy$1.class:?]
at cf.terminator.laggoggles.util.RunInServerThread.onServerTick(RunInServerThread.java:19) ~[RunInServerThread.class:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_62_RunInServerThread_onServerTick_ServerTickEvent.invoke(.dynamic) ~[?:?]
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) ~[EventBus.class:?]
at net.minecraftforge.fml.common.FMLCommonHandler.onPostServerTick(FMLCommonHandler.java:265) ~[FMLCommonHandler.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:785) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:590) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Fix:
Looks like ProfileResult#createPackets doesn't account for a case where OBJECT_DATA is empty, so line 190 tries to access the arraylist at index -1. Adding a simple check like "if (!list.isEmpty())" before line 190 should fix it.
LagGoggles-FORGE-1.12.2-4.1
forge-1.12.2-14.23.4.2703-installer-win
Think I might be having the same problem. Generally it's been fine, but running it in the Nether on a Server causes this:
crash-2018-05-26_12.13.13-server.txt
If I run the Forge version of LagGoggles, it works on my SpongeForge server. However, if I run the SpongeForge version of LagGoggles on my SpongeForge server, I get this crash.
I'm currently working on a massive project (to pay my rent), so development has stalled. I think you can imagine after a full day of non-stop coding for a company without breaks (including all-nighters and eating while coding) I don't have the 'umpff!' to update LagGoggles.
I'm sorry LagGoggles isn't as stable as expected in this state, and it does require a full rewrite. (See set milestone)
However, after this project I do intend to update LagGoggles with the in-game overlay and a web page as interface, and proper API's for other developers to build upon