Compile ok, but network broken

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
Lathanda
Space Floater
Posts: 24
Joined: Mon Feb 08, 2010 9:35 pm
Location: Germany, Pfarrkirchen

Compile ok, but network broken

#1 Post by Lathanda »

I try to compile the actual svn with VC++2008 express
using boost 1.42 and python 2.6.5.

After changing the project settings I can generate all files.
But when starting a game, the AI, client and server get disconnect errors.
AI and Client, are receiving endoffile error, and the server all clients disconnected.

Anyone an idea whats going wrong?

Logs
Freeorion
...
2010-02-15 11:59:45,687 DEBUG Client : InitializeSystemGraph(0) system_ids:
2010-02-15 11:59:45,687 DEBUG Client : ... 6
2010-02-15 11:59:45,687 DEBUG Client : ... 21
2010-02-15 11:59:45,687 DEBUG Client : ... 36
2010-02-15 11:59:45,687 DEBUG Client : ... 39
2010-02-15 11:59:45,687 DEBUG Client : ... 51
2010-02-15 11:59:45,687 DEBUG Client : ... 54
2010-02-15 11:59:45,687 DEBUG Client : ... 57
2010-02-15 11:59:45,687 DEBUG Client : ExtractMessage universe deserialization time 31
2010-02-15 11:59:45,874 DEBUG Client : ClientNetworking::NetworkingThread() : Networking thread will be terminated due to disconnect exception "End of file"
FreeorionAI
1
...
2010-02-15 11:59:45,874 DEBUG AI : ClientNetworking::NetworkingThread() : Networking thread will be terminated due to disconnect exception "End of file"
2010-02-15 11:59:45,936 DEBUG AI : Cleaning up / destructing Python AI
2010-02-15 11:59:45,936 DEBUG AI : Shutting down AI_1 logger...
2
...
2010-02-15 11:59:45,874 DEBUG AI : ClientNetworking::NetworkingThread() : Networking thread will be terminated due to disconnect exception "End of file"
2010-02-15 11:59:45,921 DEBUG AI : InitializeSystemGraph(1) system_ids:
2010-02-15 11:59:45,921 DEBUG AI : ... 27
2010-02-15 11:59:45,921 DEBUG AI : ... 28
2010-02-15 11:59:45,921 DEBUG AI : ... 46
2010-02-15 11:59:45,921 DEBUG AI : ... 48
2010-02-15 11:59:45,921 DEBUG AI : ... 59
2010-02-15 11:59:45,921 DEBUG AI : ExtractMessage universe deserialization time 47
2010-02-15 11:59:45,921 DEBUG AI : Message::GAME_START loaded_game_data: 0
2010-02-15 11:59:45,921 DEBUG AI : Message::GAME_START Starting New Game!
2010-02-15 11:59:45,921 DEBUG AI : New game started
2010-02-15 11:59:45,921 DEBUG AI : Initialized foAIstate class
2010-02-15 11:59:45,921 DEBUG AI : PythonAI::GenerateOrders : initializing turn
2010-02-15 11:59:45,968 DEBUG AI : Universe::UpdateMeterEstimates time: 47
2010-02-15 11:59:45,968 DEBUG AI : Universe::InitMeterEstimatesAndDiscrepancies time: 47
2010-02-15 11:59:45,968 DEBUG AI : Universe::UpdateMeterEstimates time: 0
2010-02-15 11:59:45,968 DEBUG AI : AIInterface::InitTurn time: 47
2010-02-15 11:59:45,968 DEBUG AI : EMPIRE: Setinon TURN: 1
2010-02-15 11:59:45,968 ERROR AI : ClientNetworking::SendMessage can't send message when not connected
3
...
2010-02-15 11:59:45,874 DEBUG AI : ClientNetworking::NetworkingThread() : Networking thread will be terminated due to disconnect exception "End of file"
2010-02-15 11:59:45,952 DEBUG AI : Cleaning up / destructing Python AI
2010-02-15 11:59:45,952 DEBUG AI : Shutting down AI_3 logger...
Freeoriond
...
2010-02-15 11:59:45,562 DEBUG Server : Sending GameStartMessages to players
2010-02-15 11:59:45,578 DEBUG Server : GetEmpireKnownObjectsToSerialize
2010-02-15 11:59:45,640 DEBUG Server : GetEmpireKnownObjectsToSerialize
2010-02-15 11:59:45,749 DEBUG Server : GetEmpireKnownObjectsToSerialize
2010-02-15 11:59:45,827 DEBUG Server : GetEmpireKnownObjectsToSerialize
2010-02-15 11:59:45,874 DEBUG Server : (ServerFSM) ~WaitingForSPGameJoiners
2010-02-15 11:59:45,874 DEBUG Server : (ServerFSM) PlayingGame
2010-02-15 11:59:45,874 DEBUG Server : (ServerFSM) WaitingForTurnEnd
2010-02-15 11:59:45,874 DEBUG Server : (ServerFSM) WaitingForTurnEndIdle
2010-02-15 11:59:45,874 DEBUG Server : ServerApp::HandleMessage type 10
2010-02-15 11:59:45,874 DEBUG Server : (ServerFSM) WaitingForTurnEndIdle.SaveGameRequest
2010-02-15 11:59:45,874 DEBUG Server : (ServerFSM) ~WaitingForTurnEndIdle
2010-02-15 11:59:45,874 DEBUG Server : (ServerFSM) WaitingForSaveData
2010-02-15 11:59:45,936 DEBUG Server : ServerFSM::HandleNonLobbyDisconnection : Lost connection to player #2, named "AI_1"; server terminating.
2010-02-15 11:59:45,936 DEBUG Server : ServerFSM::HandleNonLobbyDisconnection : All human players disconnected; server terminating.
2010-02-15 11:59:47,949 FATAL Server : Initiating Exit (code 1 - error termination)


VC++2008 Options:
Freeorion
[Compiler]
/Ox /I "../../../log4cpp/" /I "../../../../include/" /I "C:\Program Files (x86)\boost\boost_1_42" /I "../../../GG/" /I "../../include" /I "../../../../include/OGRE" /I "../../../../include/bullet" /D "FREEORION_WIN32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "FREEORION_BUILD_HUMAN" /D "BOOST_ALL_DYN_LINK" /D "_CRT_SECURE_NO_WARNINGS" /D "_SCL_SECURE_NO_WARNINGS" /D "BOOST_WINDOWS" /D "_WIN32_WINNT=0x0501" /Gm /EHsc /MD /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /wd4146 /wd4396 /wd4244 /wd4251 /wd4275 /wd4099 /wd4800 /wd4091 /errorReport:prompt
[/Compiler]
[Linker]
/OUT:"../../../freeorion.exe" /INCREMENTAL /NOLOGO /LIBPATH:"../../../../lib/" /LIBPATH:"C:\Program Files (x86)\boost\boost_1_42\lib" /LIBPATH:"../../../" /MANIFEST /MANIFESTFILE:"Release\freeorion.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"LIBCMT" /NODEFAULTLIB:"LIBCPMT" /DEBUG /PDB:"d:\FreeOrion_SDK\FreeOrion\freeorion.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE:NO /MACHINE:X86 /ERRORREPORT:PROMPT GiGi.lib GiGiOgre.lib OgreMain.lib opengl32.lib glu32.lib libpng13.lib jpeg.lib libbulletcollision.lib libbulletmath.lib glew32.lib OpenAL32.lib zlib1.lib ALut.lib libvorbisfile.lib cdt.lib circogen.lib common.lib dotgen.lib fdpgen.lib gd.lib graph.lib gvc.lib libexpat.lib neatogen.lib pack.lib pathplan.lib plugin.lib twopigen.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
[/linker]
Freeorionca:
[Compiler]
/Ox /I "../../../log4cpp/" /I "../../../../include/" /I "C:\Program Files (x86)\boost\boost_1_42" /I "C:\Python26\include" /I "../../../GG/" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "GiGi_EXPORTS" /D "FREEORION_BUILD_AI" /D "FREEORION_WIN32" /D "BOOST_ALL_DYN_LINK" /D "_CRT_SECURE_NO_WARNINGS" /D "_SCL_SECURE_NO_WARNINGS" /D "BOOST_WINDOWS" /D "_WIN32_WINNT=0x0501" /Gm /EHsc /MD /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /wd4099 /wd4146 /wd4355 /wd4251 /wd4800 /wd4267 /wd4275 /wd4244 /wd4101 /wd4258 /wd4996 /wd4312 /wd4311 /wd4091 /errorReport:prompt
[/Compiler]
[Linker]
/OUT:"../../../freeorionca.exe" /INCREMENTAL /NOLOGO /LIBPATH:"../../../../lib/" /LIBPATH:"C:\Program Files (x86)\boost\boost_1_42\lib" /LIBPATH:"C:\Python26\libs" /MANIFEST /MANIFESTFILE:"Release\freeorionca.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"d:\FreeOrion_SDK\FreeOrion\freeorionca.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE:NO /MACHINE:X86 /ERRORREPORT:PROMPT opengl32.lib glu32.lib zlib1.lib wsock32.lib cdt.lib common.lib pathplan.lib libexpat.lib python26.lib boost_python-vc90-mt-1_42.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
[/Linker]
Freeoriond
[Compiler]
/Ox /I "../../../log4cpp/" /I "../../../../include/" /I "C:\Program Files (x86)\boost\boost_1_42" /I "../../../GG/" /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "GiGi_EXPORTS" /D "FREEORION_BUILD_SERVER" /D "FREEORION_WIN32" /D "BOOST_ALL_DYN_LINK" /D "_CRT_SECURE_NO_WARNINGS" /D "_SCL_SECURE_NO_WARNINGS" /D "_WIN32_WINNT" /D "BOOST_WINDOWS" /D "_WIN32_WINNT=0x0501" /Gm /EHsc /MD /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /wd4091 /wd4099 /wd4146 /wd4355 /wd4101 /wd4244 /wd4251 /wd4258 /wd4267 /wd4275 /wd4312 /wd4311 /wd4800 /wd4996 /errorReport:prompt
[/Compiler]
[Linker]
/OUT:"../../../freeoriond.exe" /INCREMENTAL /NOLOGO /LIBPATH:"../../../../lib/" /LIBPATH:"C:\Program Files (x86)\boost\boost_1_42\lib" /LIBPATH:"C:\Python26\libs" /MANIFEST /MANIFESTFILE:"Release\freeoriond.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"d:\FreeOrion_SDK\FreeOrion\freeoriond.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE:NO /MACHINE:X86 /ERRORREPORT:PROMPT opengl32.lib glu32.lib zlib1.lib wsock32.lib cdt.lib common.lib graph.lib pathplan.lib libexpat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
[/Linker]

Lathanda
Space Floater
Posts: 24
Joined: Mon Feb 08, 2010 9:35 pm
Location: Germany, Pfarrkirchen

Re: Compile ok, but network broken

#2 Post by Lathanda »

I recompiled using full network debug, I hope now someone has an idea whats going wrong.
Attachments
AI_3.log
(93.64 KiB) Downloaded 147 times
freeoriond.log
(9.77 KiB) Downloaded 144 times
freeorion.log
(172.07 KiB) Downloaded 162 times

Lathanda
Space Floater
Posts: 24
Joined: Mon Feb 08, 2010 9:35 pm
Location: Germany, Pfarrkirchen

Re: Compile ok, but network broken

#3 Post by Lathanda »

I still don't know what is going wrong, but disabling auto saves, fixes the problem.
I assume the autosave message is too soon.
So it is probably only a secondary effect, that has nothing to do with the new library, but more with the increased speed.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compile ok, but network broken

#4 Post by Geoff the Medio »

Based on the timestamps in the log files, the files you posted are from different executions of the server and client, and the AI. It might be helpful to have them all from the same run, so the timings can be compared.

If you think there's a speed issue with the save game message, try adding some Sleep(1000) or similar in a few places, to force the server or human client to wait a bit before sending or acting on save message.

For reference, I've built and run FreeOrion with boost 1.40 without trouble, but haven't tried 1.42.

Lathanda
Space Floater
Posts: 24
Joined: Mon Feb 08, 2010 9:35 pm
Location: Germany, Pfarrkirchen

Re: Compile ok, but network broken

#5 Post by Lathanda »

I fixed a dead lock now the log is more complete an tells me.

2010-02-27 22:14:13,960 DEBUG AI : ClientNetworking::SendSynchronousMessage : received response message Message: UNDEFINED 0(host) --> 0(host) ""

2010-02-27 22:14:14,002 DEBUG AI : Traceback (most recent call last):
2010-02-27 22:14:14,002 DEBUG AI : File "D:\Games\FreeOrion\default\AI\FreeOrionAI.py", line 109, in generateOrders
2010-02-27 22:14:14,016 DEBUG AI : splitFleet()
2010-02-27 22:14:14,016 DEBUG AI : File "D:\Games\FreeOrion\default\AI\FreeOrionAI.py", line 38, in splitFleet
2010-02-27 22:14:14,019 DEBUG AI : FleetUtilsAI.splitFleet(fleetID)
2010-02-27 22:14:14,019 DEBUG AI : File "D:\Games\FreeOrion\default\AI\FleetUtilsAI.py", line 19, in splitFleet
2010-02-27 22:14:14,020 DEBUG AI : fo.issueNewFleetOrder(str(shipID), shipID)
2010-02-27 22:14:14,020 DEBUG AI : RuntimeError: bad lexical cast: source type value could not be interpreted as target
2010-02-27 22:14:14,020 DEBUG AI : AIInterface::DoneTurn()
2010-02-27 22:14:14,020 ERROR AI : ClientNetworking::SendMessage can't send message when not connected
2010-02-27 22:14:14,021 DEBUG AI : PythonAI::GenerateOrders order generating time: 2047
2010-02-27 22:14:14,021 DEBUG AI : Cleaning up / destructing Python AI
2010-02-27 22:14:14,025 DEBUG AI : Shutting down AI_3 logger...

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compile ok, but network broken

#6 Post by Geoff the Medio »

Keep digging. It looks like something's messing up when the new fleet order is being issued. Try adding some debug output in FleetUtilsAI.py in the splitFleet function, using the python print command, before the fo.issueNewFleetOrder(str(shipID), shipID) call, in order to see what value shipID has. It might be None, due to fleet.shipIDs returning bad results for some reason. You might also need to trace execution through into IssueNewFleetOrder in AIInterface.cpp, checking the input more, as apparently there's not enough input sanity checks somewhere, and a bad lexical cast is happening... Hopefully the python-level debug output will reveal why, though... I'm not sure where a lexical cast would be happening in new fleet ordering, though I haven't tried tracing through before writing this.

Lathanda
Space Floater
Posts: 24
Joined: Mon Feb 08, 2010 9:35 pm
Location: Germany, Pfarrkirchen

Re: Compile ok, but network broken

#7 Post by Lathanda »

The lexical cast is a side effect of the broken network connection, so back to the network problem

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Compile ok, but network broken

#8 Post by Geoff the Medio »

Are you sure you're building all the GiGi and FreeOrion projects with the same version of Boost?

If it won't work with Boost 1.42, you could try 1.40, which I have successfully building and running FreeOrion.

Lathanda
Space Floater
Posts: 24
Joined: Mon Feb 08, 2010 9:35 pm
Location: Germany, Pfarrkirchen

Re: Compile ok, but network broken

#9 Post by Lathanda »

I found it :)

return Message(Message::REQUEST_NEW_OBJECT_ID, sender, -1, "");
doesn't work with boost 1.42 as the message length is 0 implying EOF and therefore terminating the connection

Changing it to
return Message(Message::REQUEST_NEW_OBJECT_ID, sender, -1, " ");
works.

the same for

Code: Select all

 
Message RequestNewObjectIDMessage(int sender)
{
    return Message(Message::REQUEST_NEW_OBJECT_ID, sender, -1, " ");
}
Message RequestNewDesignIDMessage(int sender)
{
    return Message(Message::REQUEST_NEW_DESIGN_ID, sender, -1, " ", true);
}
Message ServerSaveGameMessage(int receiver, bool synchronous_response)
{
    return Message(Message::SAVE_GAME, -1, receiver, " ", synchronous_response);
}
Message LobbyHostAbortMessage(int sender)
{
    return Message(Message::LOBBY_HOST_ABORT, sender, -1, " ");
}

Message ServerLobbyHostAbortMessage(int receiver)
{
    return Message(Message::LOBBY_HOST_ABORT, -1, receiver, "");
}

Message LobbyExitMessage(int sender)
{
    return Message(Message::LOBBY_EXIT, sender, -1, " ");
}

Message ServerLobbyExitMessage(int sender, int receiver)
{
    return Message(Message::LOBBY_EXIT, sender, receiver, " ");
}

Message StartMPGameMessage(int player_id)
{
    return Message(Message::START_MP_GAME, player_id, -1, " ");
}
Message StartMPGameMessage(int player_id)
{
    return Message(Message::START_MP_GAME, player_id, -1, " ");
}

Post Reply