Address Sanitizer: C

Which looking through this video: https://youtu.be/9UIIMBqq1D4?si=xVVt_IFV7ImKQPEL by Nic Barker, I came across the idea of address sanitiser. It's something that did not exist when I first learned C (a long time ago). 

Auto-generated image of imaginary code sanitiser

Anyway, this article by Ohio Supercomputer Centre () does a really good example of explaining how to use this functionality of the compiler (added to gcc from 4.8 onwards). Article link: https://www.osc.edu/resources/getting_started/howto/howto_use_address_sanitizer  

SYNTAX:

> gcc leak_detection.c -o leak_detection -fsanitize=address -static-libasan

NOTE: The address sanitiser outputs once the program is executed, not at compile time.

No comments:

Post a Comment