Project

General

Profile

Bug #767127

Server can hang in find_dispersed_position() if scenario has invalid start position

Added by Jacob Nevins almost 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Server
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

While doing task #767082, I found the server would usually hang when I started Peter Weber's old Europe map (file too old for 2.6). Coredump showed it was in find_dispersed_position(). Reducing aifill made it less likely to happen.

find_dispersed_position() has no bail-out. That map has some start positions in the sea, and no dispersion configured, so if the start position is chosen, find_dispersed_position() is inevitably going to hang forever.

Probably find_dispersed_position() should have some sort of bail-out threshold (which could be reduced to 1 for the special case of game.server.dispersion==0).

Not sure what should happen if we hit the bail-out. In other failure cases nearby in init_new_game(), the game silently drops that player's starting unit, which doesn't seem very fair (especially if that was the only city founder in the pack!); there's only a complaint if a player gets no units at all. Probably we should at least warn the player in all these cases, and maybe tell everyone and/or abort the game (although there's no abort code path here currently).

Possibly we should also make it harder to inadvertently create scenarios with unusable start positions, since it's quite easy to miss in testing. Not sure how, exactly.


Related issues

Related to Freeciv - Task #767082: Refresh old isometric maps and put them on modpack serverClosed

Related to Freeciv - Bug #767129: Nation-specific starting units can start on non-native terrain, or on hut tileClosed

History

#1 Updated by Jacob Nevins almost 2 years ago

  • Related to Task #767082: Refresh old isometric maps and put them on modpack server added

#2 Updated by Jacob Nevins almost 2 years ago

I think this is what Daniel Markstedt previously reported (with this scenario) in RT PR#39755 (2007).

#3 Updated by Jacob Nevins almost 2 years ago

  • Related to Bug #767129: Nation-specific starting units can start on non-native terrain, or on hut tile added

#4 Updated by Jacob Nevins almost 2 years ago

  • Subject changed from Server can hang in find_dispersed_position() if scenario has invalid position to Server can hang in find_dispersed_position() if scenario has invalid start position

Also available in: Atom PDF