swarm-support
[Top][All Lists]
Advanced

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

Re: On portability and testing


From: Nelson Minar
Subject: Re: On portability and testing
Date: Fri, 30 May 1997 11:35:08 -0400

Benedikt writes an important message here. Those lessons are hard to
learn. If you have the time, it's a big win to test your simulation
out on as many different operating systems as possible. The data
output should be identical in every case.

As for random, complicated memory errors.. this is one place where C
based languages really lose. Almost every other programming language
makes this kind of error easier to detect.

In C-like languages, you have several options. There's a nice little
library called "ElectricFence" that replaces malloc with a version
that can catch some heap-related bugs. It's free and works simply, and
will work directly with Objective C. It can't catch everything, but it
usually helps.

A better tool for this kind of thing is commercial software like
Purify or CodeCenter. These programs test all memory accesses for
correctness and can catch a lot of bugs. *Unfortunately*, last time I
checked there were problems that kept these tools from working with
GNU Objective C. No one officially supports it, but ObjC is enough
like C or C++ that it should work. The wrinkle seemed to be in the
startup. The __builtin_apply usage could also confuse things.

Finally, there's a free version of something like Purify called
"checker". It's not really finished, but it sort of works with
Objective C under Linux and Solaris. I found a recent version on
  ftp://uiarchive.cso.uiuc.edu/pub/systems/linux/sunsite/devel/lang/c
Newer versions of gcc are going to encapsulate some of this
functionality under the switch -fcheck-memory-usage, so maybe the
situation will improve for everyone soon.

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