Re: Finding mem leaks with mtrace() on glibc-based systems



Nate Case <nd kracked com> writes:

> Is there any reason not to use these techniques?  I was waiting for
> someone else to step in and say "this is great", or "this isn't the
> correct approach", but to no avail.  Anyone have strong opinions on
> this matter?

All I can say is that I use it all the time, even for debugging things
like ld.so.  But of course you can call me biased.

IMO every program should start with

  int
  main (int argc, char *argv[])
  {
    ...local vars...

  #ifndef NO_DEBUGGING
     mtrace ();
  #endif
  }

The mtrace() call doesn't do anything by itself, you have to set the
appropriate environment variable at runtime.  glibc itself should not
contain any leaks and therefore anything which is reported is a
problem in the application.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

_______________________________________________
gnome-hackers mailing list
gnome-hackers gnome org
http://mail.gnome.org/mailman/listinfo/gnome-hackers




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