Now, I'm trying to use poisoning function of Address Sanitizer at clang++ compiler.
I thought I should use ASAN_POISON_MEMORY_REGION macro according to this description(https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning).
And then, I wrote a brief program like below.
int main() {
int* data = new int[10];
// poisoning from data[5] to data[9]
ASAN_POISON_MEMORY_REGION(data+5, sizeof(int)*5);
for (int i=0; i<=5; ++i) {
data[i] = i;
}
}
But compiler says error: use of undeclared identifier 'ASAN_POISON_MEMORY_REGION' and not working.
Next, I add #include <sanitizer/asan_interface.h> as a header.
But It also doesn't worked correctly(with error fatal error: 'sanitizer/asan_interface.h' file not found ).
Do I have to do something setting? or include another header?