swarm-support
[Top][All Lists]
Advanced

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

Segmentation faults when overriding objects drop


From: Konrad Lang
Subject: Segmentation faults when overriding objects drop
Date: Sat, 5 Jun 1999 01:35:45 +0200 (MEST)

I encounterd a problem when overriding the drop method of an object.
When the following code was present, swarm had segmentation faults
in a great variaty of places.
We are using Swarm 1.4.1, on a Debian system with glibc2.1 and egcs2.1
compiler.

// Override the drop function from SwarmObject
-(void) drop {
  free( genotype );
  [super drop];
}

This is taken from the Breeder-1.4.1 library.
I integrated the library into my swarm and the segmentation faults occured
when more then 100 models with different Chromosomes had run.
After replacing this by a function that explicitly frees the memory and
does not touch the original drop everything seems ok.

// New free function - overriding of drop causes segmentation faults
-free {
   free( genotype );
   [super drop];
   return nil;
}

Works fine - has anybody encounterd similar problems?

konrad

-------
  ICQ#: 23489351
  Lang Konrad               Student of Computer Science in Salzburg, Austria
-------
At the source of every error which is blamed on the computer you will find
at least two human errors, including the error of blaming it on the computer.


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