HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...
Bug #815196
Can't load game after spaceship victory
0%
Description
In freeciv git master 35dabcd, I won by spaceship, then saved the game (in the attached game18-turn404-end.sav.xz). Now I can't load the game because the server gets stuck in an infinite loop. The automatic save (freeciv-T0404-Y01978-final.sav.xz) has the same problem as the attached one.
When I load the save in freeciv-gtk3.22 and click the Start button, I get an infinite stream of chat messages. Most say, "Warning: Famine feared in Eskişehir.", but there are also messages about native unrest, sea raiders, and disasters (like fire and flood). The client is stuck on the loading screen (with the list of players) and never enters the actual game. I need to send SIGTERM to freeciv-server.
The save (viewed with xzless) has phase=1 in the [game] section. Most other saves have phase=0. This seems to set game.info.phase = 1 in the code. server/srv_main.c srv_running() has a loop
while (S_S_RUNNING == server_state()) {
...
begin_turn(is_new_turn);
...
for (; game.info.phase < game.server.num_phases; game.info.phase++) {
...
}
...
end_turn();
}
GDB shows game.info.phase is 1, and game.server.num_phases is also 1, so the inner for loop never runs; but the inner loop seems to contain the logic for talking to clients. The server seems to ignore the clients and have the outer while loop be looping forever. I added a breakpoint at begin_turn, restarted the server, and set game.info.phase = 0 in GDB; this fixed my problem as the actual game appeared in my client.
Guess that Freeciv is missing logic to load saves when game.info.phase == game.server.num_phases
History
#1
Updated by Marko Lindqvist over 2 years ago
George Koehler wrote:
Guess that Freeciv is missing logic to load saves when game.info.phase == game.server.num_phases
It sounds like there's a bug in that the save is created with illegal phase number. If num_phases is 1, the only legal phase number is 0.
It wouldn't hurt if the server detected save to be illegal instead of ending to infinite loop, of course.
#2
Updated by Jacob Nevins over 2 years ago
- Tracker changed from Task to Bug
#3
Updated by Marko Lindqvist over 1 year ago
- File 0023-Avoid-infinite-loop-when-phase-from-savegame-num-pha.patch 0023-Avoid-infinite-loop-when-phase-from-savegame-num-pha.patch added
- Status changed from New to Resolved
- Sprint/Milestone set to 2.6.3
Attached patch makes server to handle such a save. I still don't know how such a save can come to being in the first place.
#4
Updated by Marko Lindqvist over 1 year ago
- Status changed from Resolved to Closed
- Assignee set to Marko Lindqvist