Integrated Dynamics

Integrated Dynamics

63M Downloads

CTD when constructing endless recursion - by accident

Exceptionfault opened this issue ยท 3 comments

commented

Hi,

I've tried to setup rules to controll an IE DieselGenerator based on the power level of an IE battery.
The idea is to kick the generator on, if level is below 20% RF storage capacity and stop it if it's above 90%.
The generator should stay offline until level goes below 20% again.

Here is my setup, tried to pseudo code it...

<powerLevel.double> = [block reader at battery, returns 0.0 to 1.0] 

<lowerBound.double> = 0.2
<upperBound.double> = 0.9

<belowLowLevel.bool>   = <powerLevel.double> <= <lowerBound.double> 
<aboveLowLevel.bool>   = <powerLevel.double> >  <lowerBound.double> 
<belowHigLevel.bool>   = <powerLevel.double> <  <upperBound.double> 

<isInRange.bool>       = <aboveLowLevel.bool> && <belowHigLevel.bool> 

<shouldRun.bool>       =  ?<isInRange.bool>              // if powerlevel is in range... 
                          true:   id( <shouldRun.bool> ) // ... do not change current status 
                          false:  <belowLowLevel.bool>   // ... otherwise start if below min level, stop if above max level 

After that I've made another copy of <shouldRun.bool> with the "id" operator and attached it to the redstone writer. The game freezed for 2 seconds and crashed. Loading the safegame results in instant crash.

Looks like an infinite recursion, resulting in a stack overflow.

`[21:40:21] [Server thread/ERROR]: Exception caught during firing event net.minecraftforge.fml.common.gameevent.TickEvent$ServerTickEvent@271c8a08:
java.lang.StackOverflowError
at java.util.HashMap.hash(HashMap.java:338) ~[?:1.8.0_25]
at java.util.HashMap.get(HashMap.java:556) ~[?:1.8.0_25]
at net.minecraft.world.chunk.Chunk.func_177424_a(Chunk.java:772) ~[asv.class:?]
at net.minecraft.world.World.func_175625_s(World.java:2402) ~[aid.class:?]
at org.cyclops.cyclopscore.helper.TileHelpers.getSafeTile(TileHelpers.java:41) ~[TileHelpers.class:?]
at org.cyclops.cyclopscore.helper.TileHelpers.getCapability(TileHelpers.java:115) ~[TileHelpers.class:?]
at org.cyclops.cyclopscore.helper.TileHelpers.getCapability(TileHelpers.java:90) ~[TileHelpers.class:?]
at org.cyclops.cyclopscore.helper.TileHelpers.getCapability(TileHelpers.java:61) ~[TileHelpers.class:?]
at org.cyclops.integrateddynamics.core.helper.PartHelpers.getPartContainer(PartHelpers.java:53) ~[PartHelpers.class:?]
at org.cyclops.integrateddynamics.core.network.PartNetwork.hasPart(PartNetwork.java:82) ~[PartNetwork.class:?]
at org.cyclops.integrateddynamics.core.network.PartNetwork.hasPartVariable(PartNetwork.java:88) ~[PartNetwork.class:?]
at org.cyclops.integrateddynamics.core.item.AspectVariableFacade.validate(AspectVariableFacade.java:64) ~[AspectVariableFacade.class:?]
at org.cyclops.integrateddynamics.core.item.OperatorVariableFacade.validate(OperatorVariableFacade.java:114) ~[OperatorVariableFacade.class:?]
at org.cyclops.integrateddynamics.core.item.OperatorVariableFacade.validate(OperatorVariableFacade.java:114) ~[OperatorVariableFacade.class:?]
at org.cyclops.integrateddynamics.core.item.OperatorVariableFacade.validate(OperatorVariableFacade.java:114) ~[OperatorVariableFacade.class:?]
at org.cyclops.integrateddynamics.core.item.OperatorVariableFacade.validate(OperatorVariableFacade.java:114) ~[OperatorVariableFacade.class:?]

Details:
Minecraft Version: 1.10.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 2262066968 bytes (2157 MB) / 3690987520 bytes (3520 MB) up to 8351383552 bytes (7964 MB)
JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx8960m -Xms256m -XX:PermSize=256m
IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
FML: MCP 9.32 Powered by Forge 12.18.3.2316 108 mods loaded, 108 mods active
`

Is there any chance getting my world to load again?

(btw, I'm using ID-1.10.2-0.7.4.jar from "Age of Engineering" modpack)

commented

Where do you see the infinite recursion in the crashlog?
I only see 4 levels of OperatorVariableFacade.validate, which seems normal for your operations.

Is there more information in the full forge log?

Perhaps your heap is just too small, maybe you can try increasing XX:PermSize a bit.

commented

Sorry, I've stripped the other 1000 lines of OperatorVariableFacade.validate. Hope the complete crash log is helpful:

crash-2017-07-12_20.30.45-server.txt

commented

Fixed in 602bdda

You can try the following dev build (still building atm...), which you can use until I release a new version, so that you can use your world again:
https://dl.bintray.com/cyclopsmc/dev/org/cyclops/integrateddynamics/IntegratedDynamics/1.10.2-0.7.5-610/IntegratedDynamics-1.10.2-0.7.5-617.jar