Project Red - Core

Project Red - Core

43M Downloads

Right clicking a Multiplexer with the screwdriver causes server thread to hang

TerrorBite opened this issue ยท 3 comments

commented

Bug encountered in singleplayer, reproduced in a fresh singleplayer world, has not been tested on a dedicated server.

After right-clicking on a Multiplexer with the screwdriver, the server thread appears to go into an infinite loop. The client still runs, but actions performed in the world have no effect.

Forge version: 10.13.3.1403 for Minecraft 1.7.10

Mods installed:

  • CodeChickenLib-1.7.10-1.1.3.136-universal (automatically installed)
  • ForgeMultipart-1.7.10-1.2.0.345-universal
  • MrTJPCore-1.1.0.31-universal
  • ProjectRed-1.7.10-4.7.0pre8.92-Base
  • ProjectRed-1.7.10-4.7.0pre8.92-Integration

System Information:

Minecraft Version: 1.7.10
Operating System: Windows 8 (amd64) version 6.2
Java Version: 1.7.0_45, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 166172184 bytes (158 MB) / 259522560 bytes (247 MB) up to 4260102144 bytes (4062 MB)
JVM Flags: 12 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -XX:-OmitStackTraceInFastThrow -Xms256M -Xmx4096M -XX:PermSize=256M -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:ParallelGCThreads=4 -XX:ParallelCMSThreads=2 -XX:+CMSClassUnloadingEnabled -XX:MaxGCPauseMillis=50
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 353.62' Renderer: 'GeForce GTX 770/PCIe/SSE2'

Stack trace from thread dump:

"Server thread" prio=6 tid=0x0000000011b44000 nid=0x3eb0 runnable [0x000000001aeae000]
   java.lang.Thread.State: RUNNABLE
        at mrtjp.projectred.integration.ComboGateLogic.cycleShape(gatepartcomb.scala:128)
        at mrtjp.projectred.integration.ComboGateLogic.cycleShape(gatepartcomb.scala:114)
        at mrtjp.projectred.integration.ComboGateLogic.cycleShape(gatepartcomb.scala:109)
        at mrtjp.projectred.integration.GatePart.configure(gatepart.scala:237)
        at mrtjp.projectred.integration.GatePart.activate(gatepart.scala:226)
        at codechicken.multipart.BlockMultipart.func_149727_a(BlockMultipart.scala:242)
        at net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:376)
        at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:556)
        at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60)
        at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9)
        at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
        at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
        - locked <0x0000000712feeb00> (a java.util.Collections$SynchronizedRandomAccessList)
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
        at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427)
        at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)

   Locked ownable synchronizers:
        - None

Seems as though the code is caught in the following infinite loop in ComboGateLogic.cycleShape():

do shape1 = ComboGateLogic.advanceDead(shape1)
while (bitCount(shape1) > maxDeadSides || 32-lead(shape1) > deadSides)

Using a debugger I have determined that Multiplexer.cycleShape() was called with parameters shape = 0, and that during the infinite loop, local var shape1 = 6.

commented

Also happens with XOR and most probably with XNOR and Pulse Former. Regular gates and gates for IC use very similar code and have the same bug.
#930

commented

Will look into this soon...

commented

Fixed via db4f557