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.
[1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
[1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
- Attachments
-
- factorio-current.log
- (478.9 KiB) Downloaded 109 times
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
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.
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.
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
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.
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.
- Stringweasel
- Filter Inserter
- Posts: 416
- Joined: Thu Apr 27, 2017 8:22 pm
- Contact:
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
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
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock |Weasel's Demolition Derby
Official Contributor to Space Exploration
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock |
Official Contributor to Space Exploration
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
Good to know.
I just started the trimming process. I wonder how long it will take
I just started the trimming process. I wonder how long it will take
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
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.
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 ;)
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
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.
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.
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
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.Stringweasel wrote: ↑Sat Aug 21, 2021 9:12 pm Does't deleting chunks just take long in general though?
If you want to get ahold of me I'm almost always on Discord.
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
You were right, fCPU was the culprit — by removing it the whole thing finished in 10s
Re: [1.1.38] [MOD] Space Exploration - surface.delete_chunk causes permanent freeze
The issue in fCPU was fixed recently