swarm-support
[Top][All Lists]
Advanced

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

Segmentation Faults after a number of iterations...


From: Darren Schreiber
Subject: Segmentation Faults after a number of iterations...
Date: Wed, 13 Oct 1999 13:40:18 -0700

I am facing a similar problem to the one Jan Kreft was hitting recently
(and apparently resolved).  My simulation is now running well... up to a
point.  At some point way down the simulation run it segmentation faults.
No backtrace is available and stepping through 60 iterations would be a
nightmare.

Marcus previously suggested

>The things to look for are:
>
>1) Arrays that can be directly indexed and overrun; any use of
>something that comes from allocBlock:, alloc:, or malloc.
>2) Drops of things that have been dropped.
>3) Use of things that have been dropped.
>4) Running out of memory
>5) Some other regime that your model enters such that it would
>start hitting other code.

I am not creating a lot of new agents after the first few runs so I don't
think it is 1 or 4.  But, I am using xmalloc to create the labels for the
nodes (again only created once and moved about).  So, first question what
is a better way of doing this naming?  I mindless copied this method from
the Banking simulation.

-setNode: (id) aCanvas {
  char *aName;

  aName=xmalloc(10);
  sprintf(aName,"C%d", agentID);

  agentNode = [OvalNodeItem createBegin: [self getZone]];
  [agentNode setCanvas: aCanvas];
  [agentNode setX: (5*[self getIssuePosition: 0]) Y: (5*[self
getIssuePosition: 1])];
  [agentNode setString: aName];
  [agentNode setFont: "{Arial 6}"];
  [agentNode setColor: "red"];
  [agentNode setBorderColor: "blue"];
  [agentNode setBorderWidth: 6];
  [agentNode setTargetId: self];
  agentNode=[agentNode createEnd];
  return self;
}

Second question, if I am dropping dropped things or using dropped things...
how can I find these errors that far down the line?


        Darren



_____________________________________________

                 Darren Schreiber
                  Attorney at Law
                 Graduate Student
             Political Science, UCLA
                address@hidden

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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