C++ - LIBUMEM Best Simple Memory Leak Detection Tool Ever

A Simple usage of libumem
  1. export LD_PRELOAD=libumem.so
  2. export UMEM_DEBUG=default
  3. export UMEM_LOGGING=transaction
  4. Execute the program collect the core
  5. Debug using core file

bash-3.00# mdb core

Loading modules: [ libumem.so.1 libc.so.1 libuutil.so.1 ld.so.1 ]
> $G

C++ symbol demangling enabled
> ::findleaks
> BUFCTL $<bufctl_audit


BUFCTL is the address outputted by the ::findleaks

  • http://developers.sun.com/solaris/articles/libumem_library.html
  • http://blogs.sun.com/amith/entry/detecting_memory_corruption_with_libumem
  • http://docs.sun.com/app/docs/doc/816-5041/casestudy-31?a=view
  • http://blogs.sun.com/hema/entry/libumem_to_detect_modify_after
  • http://docs.sun.com/app/docs/doc/816-5041/6mb7ae3ld?a=view


Labels:


About this entry