Jump to content

Liquid in cell inflates and then corrupts


Gurgel
  • Branch: Live Branch Version: Windows Pending

In the attached save, I have a vertical infinite ethanol storage. It has two problems: 1.massive inflation of liquid amount 2. corruption of the liquid value a bit later.

So there is a massive liquid inflation during the cycle 9881 (start of cycle is 720'000t in the 4 cells combined, halfway through the cycle I see 890'000t in the 4 cells) and around cycle 9883, the value of the upper, right cell corrupts and the amount of liquid becomes tiny and negative. This cell is marked with a yellow cross below. Some 100 cycles or so later the cell left of it corrupts as well. The inflation has started earlier, as there is massively too much Ethanol in this storage. I just went back to the last save I had were the cell values were not yet corrupted.

1. I have no idea where the massive increase of the amount of liquid comes from. 

2. The corruption looks like an overflow in a signed 64 Integer value that stores microgram (?) of liquid. For display that gets then converted to a float, which is hard to read as the non-exponent terminates with a point. If it is an integer overflow, I would recommend making sure that if the result in an addition can never be negative, as there is no possibility for negative liquid amounts. For that case, I would recommend just leaving the value in the cell unchanged. Adding to solid debris already works somewhat like that. 

Funnily, the Linux Kernel just had a security bug that is somewhat similar (underflow in signed integer when calculation should have been done so that negatives are impossible in the first place):  https://seclists.org/oss-sec/2022/q1/54

 

overflow002.png.427dc9a70b62e08ba11fa76b6c0521e0.png

301x.sav


Steps to Reproduce

Just let it run and observe a) what happens to the total in the 4 cells when the lowest door is closed and b) what happens to the marked cell after about 3 rounds.

  • Like 1



User Feedback


Yes, possibly. But 2 cycles later the number gets corrupted and that is likely because it grows too large. There may be some check or test in place because it never seems to change again after getting corrupted. That check is not really working though.

I guess this is an untested edge-case. To be fair, without the liquid inflation I would not have hit the amount were it corrupts. The 4 distillers only create 1.2t per cycle, so getting there would have required something like 1M cycles or so and I am at 10k.

This requires two bugs to trigger. I also think that the vertical infinite liquid storage may somehow be different from a horizontal one and that triggers the inflation.

Share this comment


Link to comment
Share on other sites

Just had this happen to me.

Build U41-498381-50

Also a vertical infinite liquid storage with Polluted Water. I didn't end up waiting for it to loop, but it did get up to 200,000T of water before I noticed. I was able to kill the bad the blocks by building airlocks on all the liquid spaces. Game seems like it's ok again, but we'll see. I've moved a saved copy of the game outside the save folder, so ping me if you want it. Was only around Cycle 550, so it wasn't a huge run before it failed.

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...