Address Sanitizer

1.only one runtime bug-finding tool can use on iOS

2.what can do:  use after free, user after return, heap/stack buffer overflow,global variable overflow and overflows in C++ containers

3.how to use:

Xcode: edit scheme -> select task -> diagnostics -> check Enable Address Sanitizer checkbox

commandLine: xcodebuild -shceme "target" test -enableAddressSanitizer YES

4.原理 在需要检测的内存区域单元(可单独访问的内存区域)前后增加poisoned memory,缺点是会带来x2~x5的性能消耗

read more:

mikes:Address Sanitizer

WWDC Video for Address Sanitizer

你可能感兴趣的:(Address Sanitizer)