記憶體錯誤檢查工具 Address Sanitizer 介紹
2024-02-16
在 C/C++ 程式中,存取越界或 use-after-free 類型的記憶體錯誤是很常見的 bug ,除了透過良好的習慣跟 design pattern 可以手工避免之外,也有一些工具在編譯過程或執行時期進行自動化的檢查。最近看到了 Google 在 2012 年發表 Address Sanitizor (簡稱 ASAN)的論文,整理一下使用方法還有論文裡面介紹 的 ASAN 實作。
/address-sanitizer-intro/program-in-c.png)