#321 Game crashes after AI defeated

Latest Subversion
closed-fixed
Zach Laine
Server (27)
8
2008-02-09
2007-12-17
Anonymous
No

After i moved one of my ships to a system containing an AI controlled planet, the game is stuck on "Downloading new game state" screen.
freeorion.log says:
2007-12-17 13:13:52,731 ERROR Client : ClientNetworking::NetworkingThread() : Networking thread will be terminated due to disconnect exception "End of file"

Console output:
HumanClientApp::HandleMessage(TURN_PROGRESS)
HumanClientApp::HandleMessage(COMBAT_START)
HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
HumanClientApp::HandleMessage(COMBAT_END)
HumanClientApp::HandleMessage(TURN_PROGRESS)
error at or after the indicated point on line 16:
graphic = "icons/specials_tiny/homeworld.png"
HumanClientApp::HandleMessage(TURN_PROGRESS)
HumanClientApp::HandleMessage(PLAYER_ELIMINATED)
Cleaning up / destructing Python AI
Cleaning up / destructing Python AI
Cleaning up / destructing Python AI

Discussion

  • Logged In: NO

    Forgot to mention:
    I am using the SVN build 624 (GiGi) and 2261 (freeorion)

     
  • Geoff Topping
    Geoff Topping
    2007-12-18

    Logged In: YES
    user_id=913462
    Originator: NO

    From the server log, after moving a Mark I into an enemy system:

    2007-12-17 18:37:37,694 DEBUG Server : Empire::ConquerBuildsAtLocationFromEmpire: conquering items located at 63 to empire 0
    2007-12-17 18:37:40,338 DEBUG Server : ServerApp::ProcessTurns : Player 3 is marked as a loser and dumped
    2007-12-17 18:37:40,338 DEBUG Server : ServerFSM::HandleNonLobbyDisconnection : All human players disconnected; server terminating.
    2007-12-17 18:37:42,341 FATAL Server : Initiating Exit (code 1 - error termination)

    The server seems to be dumping the player when an AI loses.

     
  • Geoff Topping
    Geoff Topping
    2007-12-18

    • labels: --> Server
    • assigned_to: nobody --> tzlaine
    • milestone: --> Latest Subversion
    • priority: 5 --> 8
     
  • Logged In: NO

    This may or may not be a related problem, but when I attempt to move on from Turn 111 to Turn 112 it hangs on "Downloading New Game State..." Nothing I do (including nothing) will get me to turn 112. I have the latest Mac OS X build.

     
  • Karl Chen
    Karl Chen
    2007-12-28

    Logged In: YES
    user_id=599526
    Originator: NO

    I encountered the same thing. I suspect the culprit the following code; disabling it fixes the problem:

    void ServerFSM::HandleNonLobbyDisconnection(const Disconnection& d)
    {
    //....
    //....

    if (m_server.m_networking.empty() || m_server.m_ai_clients.size() == m_server.m_networking.NumPlayers()) {
    Logger().debugStream() << "ServerFSM::HandleNonLobbyDisconnection : All human players disconnected; server terminating.";
    Sleep(2000); // HACK! Pause for a bit to let the player disconnected and end game messages propogate.
    m_server.Exit(1);
    }
    }

    With 1 human and 4 AI players (i.e. single-player), after player #4, an AI player, is eliminated, m_networking.NumPlayers() is 4 but m_ai_clients.size() is still 4, not 3. I don't see any items ever removed from m_ai_clients. So the problem may be an incorrect assumption by HandleNonLobbyDisconnection() regarding the contents of m_ai_clients, or m_ai_clients not being updated somewhere else. It's probably tricky to use m_ai_clients anyway if that represents live child processes, as the child process will still be running immediately after it disconnects.

    A more robust check might be to count the number of non-AI players still connected (is that possible?). There's a similar check in MPLobby::react(). Also, a more visible error message would be nice for this exit condition (errorStream instead of debugStream?).

    For now I just #ifdef-out the check above and the game runs fine.

    Best, Karl

    http://www.freeorion.org/forum/viewtopic.php?f=9&t=1977

     
  • Logged In: YES
    user_id=357035
    Originator: NO

    Commenting out said code block did not fix the problem for me...

    Could you please post your working code?

    - Trib'

     
  • Geoff Topping
    Geoff Topping
    2008-01-25

    • summary: Game crashes after Attacking(?) an AI planet --> Game crashes after AI defeated
     
  • Doctor VanGogh
    Doctor VanGogh
    2008-01-25

    Logged In: YES
    user_id=649776
    Originator: NO

    I think I've encountered the same bug in 0.3.1-RC7. Loading a certain savegame & hitting 'turn' will invariably hang on 'Downloading new game state'.

    I can supply the save game if this helps solving the bug.

    Console output is:
    HumanClientApp::HandleMessage(HOST_SP_GAME)
    HumanClientApp::HandleMessage(GAME_START)
    HumanClientApp::HandleSaveGameDataRequest(SAVE_GAME)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(COMBAT_START)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_ROUND_UPDATE)
    HumanClientApp::HandleMessage(COMBAT_END)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(TURN_PROGRESS)
    HumanClientApp::HandleMessage(PLAYER_ELIMINATED)
    1201303061 ERROR : ClientNetworking::NetworkingThread() : Networking thread will be terminated due to disconnect exception "Der E/A-Vorgang wurde wegen eines Threadendes oder einer Anwendungsanforderung abgebrochen."

     
  • Logged In: NO

    I get this same error, but it stops at the PLAYER_ELIMINATED line. I do not get the Python AI messages.

     
  • Zach Laine
    Zach Laine
    2008-02-09

    • status: open --> closed-fixed
     
  • Zach Laine
    Zach Laine
    2008-02-09

    Logged In: YES
    user_id=729903
    Originator: NO

    Fixed in Subversion.

     
  • Index.. WTF? :)

     
  • Index.. Not so bad :)

     
  • Index.. Huh, really? :)