Managing Memory Through Address Sanitizer and Observeing Virtual Memory
Virtual Memory Management provides the dream of infinite space. Address Sanitizer is the precipice hidden in the fog - the silent pitfall that claims the soul the moment the dream wanders into the void.
Preamble
I have recently started learning Rust. But while learning about the various types and programming model of Rust, I couldn't help but try to see the differences between Rust and C. I also revisited flexible array member in C structures. While doing that, I poked around the memory and was using various Sanitizers. Until now, I've naively used the address sanitizer. I decided to understand the output of the sanitizer and how the algorithm works. Initially, I looked into compiler specific documentation. Both GCC and clang's documentation ultimately refers to [GOOGLE_ASAN]. I plan to discuss common programming errors which causes memory related issues, how address sanitizer can be used, why it's not always reliable, and understand how to read the vmmap(1) utility on Darwin.
