[0.12.33] crash after server_save

This subforum contains all the issues which we already resolved.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

[0.12.33] crash after server_save

Post by binbinhfr »

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 :
factorio-current.log
(10.65 KiB) Downloaded 128 times
log with 2 players + 1 server :
factorio-current2.log
(15.21 KiB) Downloaded 138 times
Attachments
testmp00.zip
(749.16 KiB) Downloaded 135 times
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 14317
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12.33] crash after server_save

Post by Rseding91 »

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:
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.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.12.33] crash after server_save

Post by binbinhfr »

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.
Attachments
factorio-current.log
(12.04 KiB) Downloaded 141 times
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 14317
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12.33] crash after server_save

Post by Rseding91 »

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.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.12.33] crash after server_save

Post by binbinhfr »

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.
So you confirm it's a little bug ?
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 :geek:
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.12.33] crash after server_save

Post by Oxyd »

Fixed in 0.12.24.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.12.33] crash after server_save

Post by binbinhfr »

Oxyd wrote:Fixed in 0.12.24.
Do you mean 0.12.34, or do you mean it was fixed in the past and then unfixed ??? :-)

No answer on the pcall(game.server_save) ? Why shouldn't it be safe ?
My mods on the Factorio Mod Portal :geek:
Post Reply

Return to “Resolved Problems and Bugs”