swarm-support
[Top][All Lists]
Advanced

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

Segmentation Fault in Creating NodeItems


From: Darren Schreiber
Subject: Segmentation Fault in Creating NodeItems
Date: Tue, 14 Sep 1999 22:57:40 -0700

<x-rich>


When I build the Agent in the modelSwarm, I am having the Agent create a
node for them on the canvas.  Using the following code:


-setNode: (id) aCanvas {

  agentNode = [OvalNodeItem createBegin: [self getZone]];

  [agentNode setCanvas: aCanvas];

  [agentNode setX: 50 Y: 50];

  [agentNode setString: (const char*) agentID];

  //[agentNode setTargetID: self];

  agentNode=[agentNode createEnd];

  return self;

}


It compiles fine, but I get the following error:


Program received signal SIGSEGV, Segmentation fault.

0x41e53d in _i_NodeItem__createPaddedText (self=0x4964188, _cmd=0x4b91e8)

    at /src/Swarm/swarm/src/tkobjc/NodeItem.m:150

/src/Swarm/swarm/src/tkobjc/NodeItem.m:150: No such file or directory.

(gdb)


When I step through the problem using a break, the segmentation fault
occurs at the line agentNode=[agentNode createEnd];


Here is the backtrace:


(gdb) backtrace

#0  0x41e559 in _i_NodeItem__createPaddedText (self=0x4963db0, _cmd=0x4b4a88)

    at /src/Swarm/swarm/src/tkobjc/NodeItem.m:150

#1  0x402cd6 in _i_Agent__setNode_ (self=0x4964708, _cmd=0x4b47f0, aCanvas=0x0)

    at Agent.m:41

#2  0x4025d7 in _i_ModelSwarm__buildObjects (self=0x4962f08, _cmd=0x4b41ac)

    at ModelSwarm.m:152

#3  0x401397 in _i_ObserverSwarm__buildObjects (self=0x495fa40, _cmd=0x4b4034)

    at ObserverSwarm.m:45

#4  0x401122 in main (argc=1, argv=0x288fc74) at main.m:36

#5  0x10006b89 in _size_of_stack_reserve__ ()

#6  0x10006b9c in _size_of_stack_reserve__ ()

#7  0x4b0ebe in cygwin_crt0 ()

(gdb)


I added the line [agentNode createPaddedText]; prior to the createEnd in
the setNode method and I got the same segmentation fault but at the
createPaddedText line.


What file or directory is needed?  How do I correct this?


        Darren</x-rich>


_____________________________________________

                 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]