[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mystical segfault
From: |
Rick Riolo |
Subject: |
Re: Mystical segfault |
Date: |
Fri, 22 Feb 2002 07:32:32 -0500 (EST) |
If changed the name of your class from Button to AButton
(or anything else you choose) and it didn't give that crash.
I don't know why offhand, but the reason I tried that
was that (a) I couldn't see anything wrong with what you had
and (b) there already is something called Button in Swarm
(and so maybe it was getting confused, tho I don't know why).
BTW, two other things:
a) don't you need to put that setCount on the create:
statement for the Array?
(either that or change to the createBegin:/createEnd approach).
b) It still crashes, when it tries to fire up the
schedule. I'll leave solving that as as exercise for the reader.
- r
--
Rick Riolo address@hidden
Center for Study of Complex Systems (CSCS)
4477 Randall Lab
University of Michigan Ann Arbor MI 48109-1120
Phone: 734 763 3323 Fax: 734 763 9267
http://www.pscs.umich.edu/PEOPLE/rlr-home.html
On Fri, 22 Feb 2002, Ken Gosier wrote:
> Date: Fri, 22 Feb 2002 07:12:54 -0500 (EST)
> From: Ken Gosier <address@hidden>
> Reply-To: address@hidden
> To: address@hidden
> Subject: Mystical segfault
>
> Hello, I posted to this list a bit last year. I've been off doing other
> things for a while, but now I'm hoping to get more back into swarm stuff.
>
> To get back into a swarm state of mind, I thought it'd be fun to code up
> Stuart Kauffman's "Buttons and Threads" models which he describes in at
> least 2 of his books. In this model you have a set of buttons laying
> around. You gradually start connecting the buttons two at a time by adding
> in threads. The punchline is, as the number of threads becomes larger than
> 0.5 * the number of buttons, you should have a "phase shift" where the
> largest cluster size quickly becomes much larger.
>
> So I've written up a simple sim in swarm to do this. The problem is,
> I'm getting a seg fault I haven't been able to figure out. Even though
> the code isn't very complicated, a few hundred lines.
>
> The model set-up is, the modelSwarm contains an Array of Button objects,
> where Buttons are really just holders for integers. (Each Button has an int
> which distinguishes it.)
>
> The segfault happens in the buildObjects method for modelSwarm. I have a
> loop where I create the Buttons, then assign them their values. When I try
> to send a Button a 'set' message, I get the segfault. I'm attaching the
> code as a tarball. Specifically, the segfault happens at line 181 of
> ModelSwarm.m. The output of gdb here is:
>
> 181 [thisButton setButtonVal: i];
> (gdb) next
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x401c34d5 in swarm_directory_objc_find (env=0x0, object=0x8116908)
> at /usr/src/redhat/BUILD/swarm-2.1.1/src/defobj/directory.m:206
> 206 /usr/src/redhat/BUILD/swarm-2.1.1/src/defobj/directory.m: No such
> file or directory.
>
> If it helps: I'm running swarm-2.1.1 on rh6.2 with gcc-2.91. I installed
> from the tarball, and I'm able to compile and run heatbugs fine.
>
> I can provide any more info that's needed. This is probably something very
> simple, so many thanks for any help--
>
>
==================================
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.