swarm-support
[Top][All Lists]
Advanced

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

Re: Seg fault after 2 days of simulation


From: Jan Kreft
Subject: Re: Seg fault after 2 days of simulation
Date: Wed, 13 Oct 1999 16:04:26 +0100 (BST)

Dear Marcus, D3, Ken, Ginger,

thanks very much for your advice in this matter and no less for the
consolation. I think I've found the bug now, after many days of searching!

On 20 Sep 1999, Marcus G. Daniels wrote:

> >>>>> "JK" == Jan Kreft <address@hidden> writes:
> 
> JK> I've been making many long simulations during the last weeks and
> JK> some of them crashed with a seg fault after a long time. Since I
> JK> have to wait two days to reach the same time again in the sim, I'd
> JK> like to know what I should do to track this error down.
> 
> 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.

That's what it was. I had recently made a string of size 20 as an ivar of
my bacteria. This serves as an array of booleans that identifies each
individual and its lineage. Say "mum" is 011, after division, the two
"daughters" will be 0110 and 0111. So I know who is related to whom. I
made some calculations for the necessary length of this array and figured
20 would be plenty, far more than ever needed. Bollocks. Should have coded
a check rather than relied on my "calculations". In fact, I used
population averages for this "reasoning", believing that variations won't
be very high. How could I, as an IbM advocate, do that?

Now upped the array size to 40 and the sim is still running, at 52000
steps at the moment, and the highest used length of this array is already
29.

BTW, would be better as an array of BOOL instead of char, does anyone know
if that's possible?

Many thanks indeed, Jan.

Jan Kreft                               Phone +44 (0)1222 875278
Cardiff School of Biosciences           Fax   +44 (0)1222 874305
Cardiff University                      E-mail address@hidden
PO Box 915, Cardiff CF10 3TL, UK

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



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