Page 1 of 1

[boskid][2.0.34] Crash using clone tool in editor/sandbox between surfaces (TransportLine check fails)

Posted: Fri Feb 14, 2025 3:57 pm
by evanrinehart
Basically I tried to clone a small factory from nauvis to gleba using the /editor.

Edit: I can reproduce it now.
Edit: No I can't, not reliably. I just triggered it a few times and not other times. Maybe it has to do with the cloned factory's exact state when you do the pause step. Note that it is actively processing spoilage not idle.

Version: 2.0.34

Mods enabled: space age, elevated rails, quality

Game mode: sandbox

Steps leading up to the crash:
  1. After loading the sandbox3 save, enter editor mode.
  2. Go to time tab, select the Pause button to pause time. When trying to reproduce the crash, I had to remember to do this step.
  3. In clone tab, select area, and select a particular factory on nauvis. I will screenshot the exact factory once I finish the bug report and upload the log.
  4. In the surfaces tab click generate planets.
  5. In the surfaces tab select gleba surface.
  6. In the clone tab the area selection is still active. Click somewhere to paste the factory onto newly generated gleba surface.
  7. See error message about reporting the crash and uploading log.
Attachments: current log, previous log, save file right after crash.

Here is the area that I was attempting to clone, which isn't exactly in the save because of lost progress. Sorry about that.
02-14-2025, 10-01-31.png
02-14-2025, 10-01-31.png (3.68 MiB) Viewed 756 times

Re: [2.0.34] crash when using clone tool in editor / sandbox between surfaces

Posted: Fri Feb 14, 2025 5:11 pm
by evanrinehart
While trying to get a reliable reproduction I noticed something odd.

When it crashes, it happens shortly after pasting the cloned factory onto gleba the first and only time before crashing.

If it doesn't crash upon pasting, I can paste again many times with no problems. But every paste after the first doesn't include the nauvis decorative patches which don't seem to belong on gleba.
02-14-2025, 11-04-02.png
02-14-2025, 11-04-02.png (4.36 MiB) Viewed 731 times
Included an updated save which is paused with the completed factory ready to clone, and gleba is not yet generated. Using the save you can start from step 3 and get a crash sometimes. Since it's paused that rules out the exact state of the running factory mattering.

Still not sure how to make it crash reliably.

Re: [boskid][2.0.34] Crash using clone tool in editor/sandbox between surfaces (TransportLine check fails)

Posted: Sun Feb 16, 2025 1:20 pm
by boskid
From looking at the reproductions, from the first save file i was unable to reproduce anything, however from the second save file i was able to reproduce this specific issue using following steps:
0/ Load sandbox3-bughunt-1.zip
1/ In time editor, update for 44 ticks (using "Play for limited time")
2/ With clone tool and area select, select just the underground belts where the carbon is being dropped
3/ Clone those entities anywhere nearby on the same surface
4/ Crash

Surfaces are not relevant for the reproduction steps as transport lines logic does not know anything about surfaces. Looking at this problem more, the issue is caused by the clone of the underground belt when 2 conditions are met: a/ there is an item on the underground section and b/ clone only covers the input underground belt. Issue here is that when underground belt is cloned, all items on the underground section are also cloned however clone items logic fails here because the output underground belt is missing causing input underground belt to become disconnected, this means underground lines are left disconnected with a default length of 1, and clone logic tries to insert items into that transport line at the out of bounds position causing consistency failure.

When trying to reproduce i also found other cases where the issue also shows up like when cloning a turning transport belt full of items in a place where it would get an extra side connection which forces the turning belt to become a straight one, here again the transport lines will have different length and when items are being cloned they are incorrectly inserted causing consistency issue.

Re: [boskid][2.0.34] Crash using clone tool in editor/sandbox between surfaces (TransportLine check fails)

Posted: Sun Feb 16, 2025 2:12 pm
by boskid
Thanks for the report. Issue is now fixed for 2.0.35.

Re: [boskid][2.0.34] Crash using clone tool in editor/sandbox between surfaces (TransportLine check fails)

Posted: Thu Feb 20, 2025 4:42 pm
by evanrinehart
Confirmed your steps in 2.0.34 reproduce the crash.
Confirmed the steps don't crash in 2.0.35!

And I tried some more aggressive versions of the original clone to gleba, waiting for the carbon to be in the underground as per description. Clone success every time.

Truly epic thanks