FreeOrion

Forums for the FreeOrion project
It is currently Fri May 24, 2013 2:52 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Access violation while universe generation
PostPosted: Mon Jun 08, 2009 6:55 pm 
Offline
Space Krill

Joined: Thu Jun 04, 2009 11:32 pm
Posts: 6
Location: Berlin, Germany
I encoundered an access violation with the unmodified sources from SVN in Universe::StoreTargetsAndCausesOfEffectsGroups, universe.cpp around line 997 (the iteration over effects_groups). The relevant call to this function is in Universe::GetEffectsAndTargets, same file around line 953 (iteration over buildings). The exeption gets thrown in the second iteration of this loop in my build. For some reason the debugger don't want to show me the contents of buildings (undeclared symbol).
It seems like the first passed parameter to StoreTargetsAndCausesOfEffectsGroups (effects_groups) is invalid. The debugger shows '[...]()' for its value and I've no idea what that's supposed to mean. An empty std::vector would appear as [0]().
Maybe it has to do with a recent change in buildings.txt, where the effects for BLD_SHIPYARD_BASE and BLD_SHIPYARD_ORBITAL_DRYDOCK have been removed, but even when I reverted this change the exception was still thrown.

With an ugly try { ... } catch { return; } I was able to suppress this error and ingame it seemed to be just fine, but this is certainly not the preferred way to fix this.

Can someone reproduce this error?

btw: is there an easier way to attach the debugger to the server before universe generation than hosting a multiplayergame and then joining with a second local client? Somewhere I read about a --force-external-server option, but it seems as if it has been removed.

_________________
Object extends Chuck Norris


Top
 Profile  
 
 Post subject: Re: Access violation while universe generation
PostPosted: Mon Jun 08, 2009 7:55 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 7898
Location: Vancouver, BC
Peter wrote:
I encoundered an access violation...

Consistently, or just once? With any particular galaxy setup options or with any? Does it happen with the v0.3.13 release as well? Immediately after starting a new single-player game when running the program, or only after resigning a game and starting another, or only when starting a multiplayer game?

Quote:
For some reason the debugger don't want to show me the contents of buildings (undeclared symbol).

Add debug output to console or log file. To do this, iterate through whatever container you're interested in and output something relevant about its contents:
Code:
for (std::map<A, B>::const_iterator it = container.begin() it != container.end(); ++it)
    std::cout << "info: " << it->second->Name() << " or some such...";


Quote:
It seems like the first passed parameter to StoreTargetsAndCausesOfEffectsGroups (effects_groups) is invalid. The debugger shows '[...]()' for its value and I've no idea what that's supposed to mean. An empty std::vector would appear as [0]().

Is there a little + button? If there's a bunch of stuff in a container, the MSVC debugger sometimes lets you expand the container. If it's gotted confused and can't evaluate the container properly, it sometimes says it has 500000 entries in it, or somesuch, though.

Quote:
Maybe it has to do with a recent change in buildings.txt, where the effects for BLD_SHIPYARD_BASE and BLD_SHIPYARD_ORBITAL_DRYDOCK have been removed, but even when I reverted this change the exception was still thrown.

It's more likely related to the one before that: http://freeorion.svn.sourceforge.net/vi ... ision=3041 in which building effects were made optional.

Quote:
Can someone reproduce this error?

Possibly, if you can be more specific (see above).

Quote:
btw: is there an easier way to attach the debugger to the server before universe generation than hosting a multiplayergame and then joining with a second local client?

When on the single player galaxy setup screen, the server has already been launched and can be connected with the MSVS debugger.

Quote:
Somewhere I read about a --force-external-server option, but it seems as if it has been removed.

freeorion -h wrote:
--force-external-server
Force the client not to start a server, even when hosting a game on
localhost, playing single player, etc.


Top
 Profile  
 
 Post subject: Re: Access violation while universe generation
PostPosted: Tue Jun 09, 2009 7:12 pm 
Offline
Space Krill

Joined: Thu Jun 04, 2009 11:32 pm
Posts: 6
Location: Berlin, Germany
Quote:
Consistently, or just once? With any particular galaxy setup options or with any? Does it happen with the v0.3.13 release as well? Immediately after starting a new single-player game when running the program, or only after resigning a game and starting another, or only when starting a multiplayer game?


This happens consistently. I tried all available galaxy shapes, various variations of age planet density etc. and multiple numbers of AIs (including none).
It doesn't happen with the release build though.

Quote:
Is there a little + button? If there's a bunch of stuff in a container, the MSVC debugger sometimes lets you expand the container. If it's gotted confused and can't evaluate the container properly, it sometimes says it has 500000 entries in it, or somesuch, though.


No, there isn't. Actually it would be surprising, because all other calls to this function before the one causing the exception pass a vector of size 1.

I'm currently fiddling with some debug output and post here if I find something more significant.

_________________
Object extends Chuck Norris


Top
 Profile  
 
 Post subject: Re: Access violation while universe generation
PostPosted: Wed Jun 10, 2009 6:28 pm 
Offline
Space Krill

Joined: Thu Jun 04, 2009 11:32 pm
Posts: 6
Location: Berlin, Germany
I just run svn up, rebuilt the whole project and the error disappeared. I decided to treat it as a cosmic ray.
Thanks for your help anyway.

_________________
Object extends Chuck Norris


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group