swarm-support
[Top][All Lists]
Advanced

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

Re: Segmentation Fault in Creating NodeItems


From: William S. Shu
Subject: Re: Segmentation Fault in Creating NodeItems
Date: Wed, 15 Sep 1999 17:08:14 +0100

Paul,
What about methods created by myself.  Will they also cause segfaults?  (It
seems I am missing something.) Can I use them on the partially created object
within +createBegin: ?   I have been using such with no problems.  Now that I am
having unexplained creeping seg-faults, everything is up for review!

William.


Darren Schreiber wrote:

> Paul thanks for the explanation about only putting those methods from the
> creating phase inside.  Like so many things, it seems obvious now that I
> know it.
>
> Unfortunately, I moved the those commands and still got the same error.
>
> Any other ideas out there?
>
> BTW, the canvas appears on the screen w/o incident.
>
>         Darren
>
> >Darren Schreiber wrote:
> >>
> >> 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];
> >
> >I think the problem is that you have some methods from the "using"
> >section inside your createBegin/End brackets.
> >
> >Only commands that show in the docs in the creating phase can go between
> >those two.  Absolutely for certain you don't want setX:Y:, setString: in
> >there.
> >
> >Move those after createEnd and I bet it works OK
> >
> >--
> >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
> >
> >                  ==================================
> >   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.
>
> _____________________________________________
>
>                  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.


                  ==================================
   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]