October 6, 2018

AddressSanitizer (ASAN) examples

AddressSanitizer is a great tool for finding bugs in C or C++ projects. It consists of some instrumentation added to code at compile time, as well as a dynamically linked runtime. Good test coverage is required, as it detects problems at runtime, while running your test-suite. To use it, supply -fsanitize=address to both the compiler and linker when building for tests (works in newer versions of clang and gcc). There are great resources for understanding how it works, but when I started, I was missing a few simple examples. Read more

© Ole Herman Schumacher Elgesem 2021

Powered by Hugo & Kiss.