Re: AbiWord is too buggy for Bonita

From: Michael D. Crawford <crawford_at_goingware.com>
Date: Thu Mar 17 2005 - 21:56:23 CET

One some platforms, there are debugging memory allocators. I think on
OS X, one can set the environment variable MALLOC_DEBUG, and then it
checks for all sorts of error conditions. It should also work under
Linux and BeOS.

I think I can do that under Windows if I can build with gcc. Visual C++
probably has some such debugging support but I don't know yet what it
might be.

I've long used a tool called Spotlight, from http://www.onyx-tech.com/
to find memory bugs on a Mac. But I'm afraid it is Mac OS-9 only, it
doesn't work on OS X. It's been several years since they released it
with no updates since. I'm hoping they have an OS X tool in the works,
because for a long time their domain had expired, but they recently
resurfaced.

It is not too hard to roll your own memory debugger, that may allow
better control and ease of use. One simple thing to do is to allocate a
block a little larger than what you need, initialize a header and
trailer at each end of the block, and pass back to the caller a pointer
just pass the header.

Then if you write off either end of the block, you can easily detect it,
and if you're lucky, even a read off either end might get the bogus
value you initialized your header too, and turn an unreproducible bug
into a reproducible one.

You can also do leak detection with a custom allocator.

Best,

Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
crawford@goingware.com

    Tilting at Windmills for a Better Tomorrow.
Received on Thu Mar 17 21:57:41 2005

This archive was generated by hypermail 2.1.8 : Thu Mar 17 2005 - 21:57:41 CET