Logistics Pipes

Logistics Pipes

13M Downloads

Infinite loop in LogisticsPowerProviderTileEntity

firelizzard18 opened this issue ยท 7 comments

commented

As far as I can tell, there's an infinite loop in LogisticsPowerProviderTileEntity that's eating all of my CPU (the core that's running MC). Build 114.

"Server thread" #23 prio=5 os_prio=0 tid=0x00007efdd0ffa800 nid=0xc86 runnable [0x00007efdb6098000]
   java.lang.Thread.State: RUNNABLE
        at logisticspipes.renderer.LogisticsTileRenderController$LaserKey.hashCode(LogisticsTileRenderController.java:35)
        at java.util.HashMap.hash(HashMap.java:338)
        at java.util.HashMap.containsKey(HashMap.java:595)
        at logisticspipes.renderer.LogisticsTileRenderController.addLaser(LogisticsTileRenderController.java:197)
        at logisticspipes.pipes.basic.LogisticsTileGenericPipe.addLaser(LogisticsTileGenericPipe.java:468)
        at logisticspipes.blocks.powertile.LogisticsPowerProviderTileEntity.sendPowerLaserPackets(LogisticsPowerProviderTileEntity.java:163)
        at logisticspipes.blocks.powertile.LogisticsPowerProviderTileEntity.func_145845_h(LogisticsPowerProviderTileEntity.java:124)
        at logisticspipes.blocks.powertile.LogisticsRFPowerProviderTileEntity.func_145845_h(LogisticsRFPowerProviderTileEntity.java:58)
        at net.minecraft.world.World.func_72939_s(World.java:1939)
        at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:489)
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334)
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
commented

May be related to #1065

commented

infinite loop inside of a hashmap? i don't know this code but i do remember causing this once when i had a hasmap of objects and accidentaly added the hashmap into itself (i know, very stupid but at the time i was messing around with them to learn how they worked)

commented

I've debugged this in Eclipse and the issue is that LogisticsPowerProviderTileEntity.sendPowerLaserPackets gets stuck in an infinite loop.

commented

There are two pipes that the loop is cycling between. One will get put on the todo list, then the other, then the first, then the second, etc, forever.

commented

I don't grok sendPowerLaserPackets, so I don't know how to actually fix the issue. But I just committed a change (f40516a) that at least prevents the infinite loop issue. Some lasers don't render, but it's good enough to get my server back up.

commented

Will look into this as soon as possible, as I recently stumbled across this code part..
It wont be so soon though, as I have RL things to worry about atm.

commented

@theZorro266 don't worry, just draw a Z and done! ๐Ÿ˜„