swarm-support
[Top][All Lists]
Advanced

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

Mystical segfault


From: Ken Gosier
Subject: Mystical segfault
Date: Fri, 22 Feb 2002 07:12:54 -0500 (EST)

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

-- 
Ken Gosier
address@hidden

Attachment: ButtonThread.tgz
Description: GNU Zip compressed data


reply via email to

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