Page 1 of 1

[12.26] Headless Server Hangs

Posted: Fri Mar 18, 2016 1:57 pm
by NoPantsMcDance
I keep having this issue where the server will just randomly hang. From the logs I don't see any errors or anything that would make it obvious (to me atleast) what would be causing this. If I send a SIGINT to factorio it still refuses to shutdown and I have to kill the screen it's running in. Attaching the log and the latest save. This isn't very reproducible so idk if it's just my server or what's going on.

Re: [12.26] Headless Server Hangs

Posted: Fri Mar 18, 2016 2:23 pm
by prg
Maybe try getting a backtrace when that happens.

Code: Select all

gdb --pid=$(pidof factorio) --batch --ex 'thr apply all bt f'

Re: [12.26] Headless Server Hangs

Posted: Sat Mar 19, 2016 12:38 am
by daniel34
I've had the same happen to me, also on a vanilla server, three times I think in the week the map was played (04 Mar - 10 Mar, 0.12.25-0.12.26).
It may be save specific, as I didn't have that issue with the map before that and the one currently (since Mar 10) playing.

It was be the same behavior as in NoPantsMcDance's log: the server would just freeze and you'd be unable to connect, but looking at the console it seemed fine. When sending SIGINT it showed the line "Received SIGINT, shutting down" and you saw the big difference in log time (hours after the last line), but it wouldn't stop right away.
Only after sending SIGINT a few more times or killing it did the server stop.

If it happens again I'll try to get a backtrace.

Re: [12.26] Headless Server Hangs

Posted: Sat Mar 19, 2016 12:11 pm
by daniel34
Maybe not so save specific, as it happened this night on a vanilla map that has been running without crash for > 5 days.
Server Log
As explained above server doesn't accept connections, sending SIGINT will write the last line to the log file, sending SIGINT again actually stops the process.
Backtrace

Re: [12.26] Headless Server Hangs

Posted: Mon Mar 21, 2016 1:29 pm
by kovarex
Can you provide the save game?

Edit: I mean, it almost looks, like there were more than 255 players in the save game (all of them can be offline, but it would still result in this).

Re: [12.26] Headless Server Hangs

Posted: Mon Mar 21, 2016 3:59 pm
by daniel34
kovarex wrote:Can you provide the save game?

Edit: I mean, it almost looks, like there were more than 255 players in the save game (all of them can be offline, but it would still result in this).
Savegame (the last autosave before the hang): http://188.165.250.160:34197/bug-21771.zip

Is that an actual hard limit? Then I guess we have reached it.
When I load the save in multiplayer mode, then game.local_player.index and #game.players both give me 255.
Yup, that might be it

Re: [12.26] Headless Server Hangs

Posted: Mon Mar 21, 2016 5:26 pm
by kovarex
daniel34 wrote:
kovarex wrote:Can you provide the save game?

Edit: I mean, it almost looks, like there were more than 255 players in the save game (all of them can be offline, but it would still result in this).
Savegame (the last autosave before the hang): http://188.165.250.160:34197/bug-21771.zip

Is that an actual hard limit? Then I guess we have reached it.
When I load the save in multiplayer mode, then game.local_player.index and #game.players both give me 255.
Yup, that might be it
I never expected this to happen :)
I increased the limit to 65535 for 0.12.27, and when it is reached, the server crashes with the proper error message instead of freezing.
(the limit of 255 players at the same time is still there, but I guess that is not a problem).