This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Status of GCC memory checking, -fcheck-memory-usage


On Sun, Feb 10, 2002 at 05:56:03PM +0100, Carlo Wood wrote:
: What is inferior about libcwd as malloc debug library?
: If you care to clarify then I will fix it, whatever it is.

I've tried ccmalloc and dmalloc, so I apologize if the following
doesn't apply to the situation of libcwd.

What I miss with those libraries is the kind of bounds checking
that Checker can do. Usually malloc libraries either check
memory around an allocated region by placing magic bit patterns
around it and checking at the time of free, or at some pre-scheduled
times inbetween. An exception would be efence which uses VM tricks.
Both approaches have a problem: VM tricks are costly for many small
allocations, and magic numbers do not report the bounds violation
right away.

Since Checker's principal manner of operation is different (using
the -fcheck-memory-usage feature of gcc), it delivers error reports
right on spot, exactly when and where the out-of-bounds access is
happening.

The general drawback of Checker is that it's very slow.
It is, however, by far the most extensive and comprehensive
free tool in that class AFAIK.

: Sure, what libcwd misses is memory access checking: a check on EVERY
: memory access whether or not it is to initialized memory.  But for
: that it needs hooks, generated by gcc/g++.  It is these hooks that
: are now missing.

Those were in -fcheck-memory-usage if I understood correctly.

Claus

-- 
Claus Fischer <claus.fischer@clausfischer.com>
http://www.clausfischer.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]