Electric Fence stops your program on the exact instruction that overruns (or underruns) a malloc() memory buffer. GDB will then display the source-code line that causes the bug. It works by using the virtual-memory hardware to create a red-zone at the border of each buffer - touch that, and your program stops. Catch all of those formerly impossible-to-catch overrun bugs that have been bothering you for years.
e5be3a38a0d2b71ba558eb310a2db44ea6e7c208e16d4fd907dc6ed11c46b1a7