[1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Place to get help with not working mods / modding interface.
Post Reply
TwoAbove
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 15, 2021 3:56 pm
Contact:

[1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by TwoAbove »

Hello!

To reproduce, just load the game and try running any surface trim tool (both SE's one or to Delete Chunk mod). Both will successfully delete the chunks, but after the game will just freeze and will only be killable (sigterm does not work, only sigkill).

A single surface.delete_chunk command also causes this.

Save file: https://drive.google.com/drive/u/1/fold ... shsslYpVMl

No error logs are saved, unfortunately.
Attachments
factorio-current.log
(478.9 KiB) Downloaded 86 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by Rseding91 »

Thanks for the report. I looked into it and the issue is: when you trim the surface it deletes a crazy amount of entities (of which almost all are registered in the entity-destroyed event logic).

The end result is: there are 485642 entities deleted (when I trim nauvis) and all of them get put into the to-event list for the on_entity_destroyed event. The game then goes to send those events and the listening mods are doing some super slow operation such that each entity takes 0.2 seconds to process in the mods event handlers.

I estimate if you let it run on my laptop it would be done in 27 hours. Alternatively you can try contacting the mod authors and see which one of them has some poor-performance code making the events take so long.
If you want to get ahold of me I'm almost always on Discord.

TwoAbove
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 15, 2021 3:56 pm
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by TwoAbove »

Wow, that's crazy!

Are there any traces available or something, so I can better pin-point which mod is causing this?

Also, how did you calculate the time it takes to go the event processing? That would have helped debug this issue from my end.

User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 315
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by Stringweasel »

Does't deleting chunks just take long in general though? I don't have much experience in trimming surfaces in SE, but when I reduce save files for the Hall of Fame I sometimes need to let it run through the night. And there was no mod handlers running, only tons and tons of entities.
Alt-F4 Author | Factorio Modder
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby

TwoAbove
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 15, 2021 3:56 pm
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by TwoAbove »

Good to know.

I just started the trimming process. I wonder how long it will take

User avatar
jan1i3
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by jan1i3 »

We have done some profiling as a group effort in the discord and have noticed that by far the slowest mod in this case is fCPU.
You can see the report for details.

As for what you can do... well
Removing the mod, trimming and then adding the mod again isn't really an option.
So, unless i'm terribly wrong, i don't think there is anything you can do in the meantime except wait for the bug to be fixed. Or wait 27 hours, possibly longer if your pc is slower.

There is still the chance there is another mod causing issues (we're still waiting on more data for that), but as i said fCPU is by far the biggest one.
Also known as JanSharp. jan1i3 was/is my old name ;)

TwoAbove
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 15, 2021 3:56 pm
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by TwoAbove »

Disabling Treees seems to have made it faster, when checking by deleting 1 chunk. I don't think I have many fCPUs in the world.

Turns out the mod adds all trees to a list, and deleting many trees from a chunk deletes them from this enormous list.

I'd say this thread might be more suited for a not-a-bug status.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by Rseding91 »

Stringweasel wrote:
Sat Aug 21, 2021 9:12 pm
Does't deleting chunks just take long in general though?
No, deleting chunks is near instant on the C++ side of things. Most if not all slowdown that might occur is from the mod(s) implementing a "scan the chunk to see what's on it before deleting it" and or reacting to it being deleted.
If you want to get ahold of me I'm almost always on Discord.

TwoAbove
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Aug 15, 2021 3:56 pm
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by TwoAbove »

You were right, fCPU was the culprit — by removing it the whole thing finished in 10s

extermeon
Burner Inserter
Burner Inserter
Posts: 7
Joined: Thu May 18, 2017 7:44 pm
Contact:

Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze

Post by extermeon »

The issue in fCPU was fixed recently

Post Reply

Return to “Modding help”