Page 1 of 1

Crash on world generation - unknown exception

Posted: Thu Nov 25, 2010 12:04 pm
by iron_gollum
I have first mentioned the problem here, but for the sake of staying ontopic, I'll continue it in this subforum. Now I've spent quite a lot of time searching for the problem, but I must admit my failure and need some help. The crash apparently occurs in Empire::Init() in the last queue (ll. 1111-1113)
Geoff the Medio wrote:A new content file was added, alignments.txt, in the default directory. If you're loading content files from a different location than where you updated from SVN, that might cause a crash.
I checked the directory where alignments.txt is being loaded from. It is the correct "default" directory. The file and the directory both exist on my file system.
Regardless, is there an error message or log file that might indicate what the problem is?
I didn't find any. Is there an option to turn on, so that a log is being recorded?

Re: Crash on world generation - unknown exception

Posted: Thu Nov 25, 2010 12:30 pm
by OndrejR
Logs are in ~/.freeorion and are automatically created. Please also delete config.xml, which may be from some old version and try again and post logs.

Re: Crash on world generation - unknown exception

Posted: Thu Nov 25, 2010 1:06 pm
by iron_gollum
Uh, I have neither such a directory, nor a config.xml file in the SDK where I am running it from.

Re: Crash on world generation - unknown exception

Posted: Thu Nov 25, 2010 3:58 pm
by OndrejR
If you are on Windows or Mac, then location is this

Re: Crash on world generation - unknown exception

Posted: Thu Nov 25, 2010 7:20 pm
by Geoff the Medio
iron_gollum wrote:The crash apparently occurs in Empire::Init() in the last queue (ll. 1111-1113)
I don't know what you mean by "the last queue", but lines 1109-1114 are:

Code: Select all

const AlignmentManager& alignment_manager = GetAlignmentManager();
const std::vector<Alignment>& alignments = alignment_manager.Alignments();
for (std::vector<Alignment>::const_iterator it = alignments.begin(); it != alignments.end(); ++it) {
    const Alignment& alignment = *it;
    m_meters[alignment.Name()];
}
You might add an std::cout << alignment.Name() << std::endl; line in that loop, to see if anything useful is being done before the crash happens... but there should be some debug output from the code in lines 1050-1063 as well, that might be more useful.
Regardless, is there an error message or log file that might indicate what the problem is?
I didn't find any. Is there an option to turn on, so that a log is being recorded?
See OndrejR's link to the location for config.xml and the log files. It is not in the SDK directory.

Re: Crash on world generation - unknown exception

Posted: Thu Nov 25, 2010 10:40 pm
by iron_gollum
Oh ok, I found it. Indeed, the last lines of the log (the whole log is about 90k lines long, so I don't post it and I can't attach it since it's 1MB) say:
Error: XML start/end tag mismatch - m_meters
2010-11-25 18:23:54,375 DEBUG Client : (HumanClientFSM) ~WaitingForTurnDataIdle
2010-11-25 18:23:54,375 DEBUG Client : (HumanClientFSM) ~WaitingForTurnData
2010-11-25 18:23:54,375 DEBUG Client : (HumanClientFSM) ~PlayingGame
2010-11-25 18:23:54,375 DEBUG Client : ClientNetworking::NetworkingThread() : Networking thread will be terminated due to disconnect exception "Der E/A-Vorgang wurde wegen eines Threadendes oder einer Anwendungsanforderung abgebrochen"
2010-11-25 18:23:55,468 ERROR Client : main() caught exception(std::exception): Unknown exception
And there is no tag called m_meters in the config. However, the funny thing is that deleting config.xml has absolutely no effect: the log file still says the same, although there is no config file in this directory any more, and no new config file is being created.

Re: Crash on world generation - unknown exception

Posted: Thu Nov 25, 2010 11:32 pm
by Geoff the Medio
It's not expected that there would be a m_meters tag in config.xml. Rather, m_meters is data in the Empire class. The only place such a tag would be present to cause such an error is in the serialization of the Empire class. Can you make sure you've rebuilt Empire.cpp before linking the server and human clients? It might help to do a full clean and rebuild. Also, is there a freeoriond.log ? Perhaps something crashed while serializing on the server, which might explain the missing close tag?

Re: Crash on world generation - unknown exception

Posted: Fri Nov 26, 2010 2:34 pm
by iron_gollum
I deleted config, rebuilt the project, now everything is running. Thanks!