Hit the same crash without Subterranio installed, so it's not that mod specifically.
What's happening:
With chunk selection set to "random", get_chunk() picks a random surface and checks it has chunks using surface.get_chunks().
It then calls surface.get_random_chunk() to pick one. Problem: that function only considers generated chunks, and some surfaces (space platforms in my case, probably Subterranio's underground layers in yours) have chunks in the iterator but none counted as generated.
On those surfaces get_random_chunk() returns nil, the nil gets passed into get_sub_chunks(), and indexing chunk.x crashes at control.lua:85.
So any mod that adds these kinds of surfaces can trigger it — it's a matter of time until the random pick lands on one.
How to patch it (unzip the mod, edit control.lua, rezip — or wait for the author):
In get_chunk(), right after the if/elseif chunk-selection block ends (just before the storage.map_marker lines, around line 72), add:
-- get_random_chunk() returns nil on surfaces with no generated chunks
-- (e.g. space platforms); skip this cycle instead of crashing
if chunk == nil then
return nil
end
In the on_nth_tick handler (around line 102), make the caller handle that nil:
if (#storage.nuclear_tiles==0 and storage.sub_chunks==nil) then
local chunk = get_chunk()
if chunk == nil then return end -- <<< add this line
storage.chunk = chunk
storage.sub_chunks = get_sub_chunks(chunk.chunk, chunk_subdivisions)
(Optional but recommended) In the two later branches that start with local surface = storage.chunk.surface, add a guard right after that line — a stored surface can be deleted mid-scan (e.g. a destroyed space platform) and crashes the same way on the next cycle:
if not surface.valid then
storage.chunk = nil
storage.sub_chunks = nil
storage.nuclear_tiles = {}
return
end
The mod just skips that cycle and picks a fresh chunk next time — no behavior change otherwise. Been running this patched for a while with no recurrence.