Hi there,
During the writing of my new mod, I had a strange repeted crash after a game.server_save under MP with 1 or 2 players and 1 headless server.
Here is the simple map and the report.
I can send you the mod by MP with a little explanation on what do do to trigger the crash.
Basically, it call a game.server_save() and then try the reconstruct some parts of my gui to display a report.
I tried using pcall(game.server_save) which shows that the save works (I see it on the time stamp of the saved file).
It is the GUI reconstruction just after the save that creates the crash. This same GUI triggers no problems for the rest of the mod, but does not do anything special after this game.server_save .
Note that my mod does not seem to trigger any desync either.
log with 1 player + 1 server :
log with 2 players + 1 server :
[0.12.33] crash after server_save
[0.12.33] crash after server_save
- Attachments
-
- testmp00.zip
- (749.16 KiB) Downloaded 135 times
My mods on the Factorio Mod Portal
Re: [0.12.33] crash after server_save
using pcall when calling save is a good way to *completely* screw the game state - don't do that.
Your actual issue is in the log file:
Your actual issue is in the log file:
15.185 Error MultiplayerManager.cpp:110: MultiplayerManager failed: "Error while running the event handler: __MayTheForceBeWithYou__/control.lua:1244: unknown flow GuiDirection value: "
If you want to get ahold of me I'm almost always on Discord.
Re: [0.12.33] crash after server_save
I use pcall to avoid error in solo mode. What else can I do ?
It was a conclusion of this thread :
viewtopic.php?f=25&t=25115
Anyway, the crash does still appear without any pcall at all (for testings I removed them from the whole mod).
And the error message concerning Gui direction is somewhat random, as I did not use any direction on a flow.
Note in the second log, that the error message is different. I send you a third log here with another message.
Infact the GUI window reconstruction function that I use after the save is used in many other situation without problem. And the save does not change anything in the GUI reconstruction. But it seems that triggering these GUI calls after the save creates a problem (even if they work in all other situations).
I send you the mod in MP.
To trigger the error, you have to run a headless server and connect with a player (it does not work with a simple MP load).
just directly click on the head button in the upleft corner, to open the interface, then click on server-save.
The basic call is in control.lua, line 406, then the info() function is called, that call window_update() to refresh the whole GUI and display a message.
Note that the error message can be different if I comment a few lines in the mod.
It was a conclusion of this thread :
viewtopic.php?f=25&t=25115
Anyway, the crash does still appear without any pcall at all (for testings I removed them from the whole mod).
And the error message concerning Gui direction is somewhat random, as I did not use any direction on a flow.
Note in the second log, that the error message is different. I send you a third log here with another message.
Infact the GUI window reconstruction function that I use after the save is used in many other situation without problem. And the save does not change anything in the GUI reconstruction. But it seems that triggering these GUI calls after the save creates a problem (even if they work in all other situations).
I send you the mod in MP.
To trigger the error, you have to run a headless server and connect with a player (it does not work with a simple MP load).
just directly click on the head button in the upleft corner, to open the interface, then click on server-save.
The basic call is in control.lua, line 406, then the info() function is called, that call window_update() to refresh the whole GUI and display a message.
Note that the error message can be different if I comment a few lines in the mod.
- Attachments
-
- factorio-current.log
- (12.04 KiB) Downloaded 142 times
My mods on the Factorio Mod Portal
Re: [0.12.33] crash after server_save
Fun... so the "server_save" is actually broken as it is now It starts saving the map and then returns to the Lua code and allows it to keep executing while the save runs and it definitely should not be doing that.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.12.33] crash after server_save
So you confirm it's a little bug ?Rseding91 wrote:Fun... so the "server_save" is actually broken as it is now It starts saving the map and then returns to the Lua code and allows it to keep executing while the save runs and it definitely should not be doing that.
Maybe I am the first modder to include it into its mod ?
By the way, you did not tell me how to avoid error in solo without using pcall on server_save ?
My mods on the Factorio Mod Portal
Re: [0.12.33] crash after server_save
Fixed in 0.12.24.
Re: [0.12.33] crash after server_save
Do you mean 0.12.34, or do you mean it was fixed in the past and then unfixed ???Oxyd wrote:Fixed in 0.12.24.
No answer on the pcall(game.server_save) ? Why shouldn't it be safe ?
My mods on the Factorio Mod Portal