[svlug] Debugging memory problems

Justin F. Knotzke shampoo at cam.org
Tue Jan 15 17:33:01 PST 2002

On Tue, Jan 15, 2002 at 05:10:36PM -0800, Sanatan Rai wrote:
> Hi,
> 	I have a simulation that runs quite well on Sun machines running
> Solaris (various).  However it seg-faults while reading some data files on
> x86. I had the same problem with Win2000 and g++ and Linux (SULinux/RH7.x)
> + g++, so it seems to me that the problem has something to do with the
> architecture. I am at a loss as to how to find the exact problem.
> 	I have tried libsafe, and it hasn't come up with anything. My own
> guess is that my routines hog too much memory, but as it doesn't seem to
> be a problem on the Suns, and I would like confirmation before I change
> anything, I am loath to tinker with them just yet.
> 	I get clean compiles on all systems, except for some warnings
> about non-ANSI features when pedantic mode is on.

	Are you using templates? If so, check those very carefully.

	Are you using multiple inheritence? I've had quite a few similiar
bugs because of improper use of multiple inheritence.

	I can say this though, it's always been my experience that g++
follows ANSI C++ to the letter. Sun's compiler and MS's seem to let all
kinds of stuff slide which will bite you in the butt later.

	I do all my final testing with g++ under Linux because if it appears
to run fine under that, it will run fine under the others.

	Best thing to do is just start limiting the code to the actual code
that causes the problem. Just start commenting stuff out until you limit
it down to a few methods..

	Good Luck,


Justin F. Knotzke
shampoo at cam.org
pgp public key http://www.shampoo.ca/pubkey.html

More information about the svlug mailing list