Debug Libraries Many libraries are useful for program debugging, especially with regards to memory leaks and memory corruption in C/C++ programs. 'dmalloc' is a library useful for locating memory leaks in programs. it overrides calls to malloc/free, and generates extensive logging of all memory allocations, allowing the program to find memory leaks when the program exits. 'electric fence' is a library useful for finding memory corruptions, using segmentation faults, by allocating all memory blocks on page boundaries. It comes as standard on various Linux distributions. Look also at GNU Checker and YAMD for similar tools.