Running the test cases with ASan

To refresh our memory, here is the help screen from our membugs program:

$ ./membugs_dbg_asan Usage: ./membugs_dbg_asan option [ -h | --help] option =  1 : uninitialized var test case option =  2 : out-of-bounds : write overflow [on compile-time memory] option =  3 : out-of-bounds : write overflow [on dynamic memory] option =  4 : out-of-bounds : write underflow option =  5 : out-of-bounds : read overflow [on compile-time memory] option =  6 : out-of-bounds : read overflow [on dynamic memory] option =  7 : out-of-bounds : read underflow option =  8 : UAF (use-after-free) test case option =  9 : UAR (use-after-return) test case option = 10 : double-free test case option = 11 : memory leak test case 1: simple leak option ...

Get Hands-On System Programming with Linux now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.