Astral Sorcery

Astral Sorcery

63M Downloads

Infinite Loop when world time is Negative

ruifung opened this issue ยท 5 comments

commented

With the previous changes to prevent crahes in 06d1d7, it looks like in my environment, it looks like it is causing the doConstellationInteration function to infinitely loop instead. Likely due to dayDistributionMap.get(activeDay) likely returning null.

It should be noted that I have galacticraft installed, and this is a server.
The above is because using Draconic Evolutions celestial manipulator to skip time on the moon causes a hang too.

Is it possible that the value of activeDay is < 0 or >= 8 ?

Additional Note: /time query day on the moon gives -3042795.
Additional Note 2: After resetting the negative time value to a non negative value it no longer happens. Leaving issue open as you might want to increase the robustness of this function.

JVisualVM Sampler Snapshot (352 seconds in setupInitialFunctions)
https://puu.sh/AGmgp/efcce82d7f.nps

Thread Dump
https://pastebin.com/cA47BzW9

commented

One might raise the question why it's day -WHATEVER on the moon instead of it having sane days...

Aaaand i just released 1.9.1 before this issue was reported aswell >_>

commented

Well, yeah its a wonder how the time got to negative lol.

commented

int activeDay = ((lastRecordedDay % 8) + 8) % 8;

That should do the trick.

Edit: oh wait, no...

Edit2: oh wait, it does... or does it? I'm getting confused now... xD

commented

I do wonder if the time and day values in tick() being negative would have any effect, just in case.

commented

Yea, i'm looking through stuff and accounting for it. Thanks for pointing this out.