ASan & LSan

Last updated

What is ASan & LSan?

AddressSanitizer (ASan) and LeakSanitizer (LSan) are compiler-integrated tools, enabled with a flag like -fsanitize=address, that detect memory errors and leaks respectively by instrumenting the compiled code to check memory accesses at runtime. ASan catches issues such as buffer overflows, use-after-free, and use of memory after it goes out of scope, reporting the exact location of the error. Compared to tools like Valgrind, sanitizers typically run faster since the checks are built into the compiled binary itself rather than emulated externally.

Free resources to learn ASan & LSan

More in stage 18: Debugging

ASan & LSan: common questions

Can I learn ASan & LSan in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain ASan & LSan in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this ASan & LSan tutorial for beginners?

It is lesson 101 of 141 in the free C Programming roadmap, in stage 18, Debugging. If you are new to C Programming, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me