This page is primarily intended for Mercurial's developers.
C Verification Tools
Ways to verify the C extension you're working on isn't broken.
ASAN is an address sanitizer that detects memory access to unallocated or previously-freed memory.
Bryan O'Sullivan describes using it with Mercurial here.