swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Modelling] status_access_violation question


From: Paul E. Johnson
Subject: Re: [Swarm-Modelling] status_access_violation question
Date: Mon, 06 Oct 2003 21:06:54 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703

Use gdb.

pj

Steve Railsback wrote:

address@hidden wrote:

Hello,

I am currently in the midst of coding my first involved swarm model,
which I am going to use in my dissertation research on early hominid
food sharing.  I've just run across a problem that I'm unable to solve
with my limited experience.  After I compile the executable (share.exe)
and run it at the command prompt, the simulation runs successfully for
anywhere from 50 to 700 time steps.  However, though it runs as it
should, the model always bails with the following error message at some
(seemingly random) point:

0 [main] share 1000 handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION


Yeah, these kind of errors are not so clear to find. In general, it means you are trying to use memory that isn't allocated--trying to store something in an array at a location bigger than the array size, trying to access a location in a Grid2D object that's beyond its boundaries, etc. When it happens after a model has run for a while, perhaps one of your agents is wandering off the edge of the world, etc.

You could try putting print statements wherever you use an array or space object, to print out the location you're trying to access before you actually do access it. Check carefully for logic errors that could cause the code to try to read a variable or array location that doesn't exist.

Steve R.



--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700




reply via email to

[Prev in Thread] Current Thread [Next in Thread]