title: AddressSanitizer Suppression
body: <p>I am trying to suppress a warning from the address sanitizer in clang/gcc</p>
  
  <p>My source file looks like this:</p>
  
  <pre><code>int foo(){
    double bar[] = {7,8};
    return bar[3];
  }
  
  int main(){
    return foo();
  }
  </code></pre>
  
  <p>and obviously there is an overflow at line 3.</p>
  
  <p>the suppression file (myasan.supp) contains:</p>
  
  <pre><code>interceptor_via_fun:foo
  </code></pre>
  
  <p>compiling (clang also creates a warning) and running:</p>
  
  <pre><code>clang -O0 -g -fsanitize=address -fno-omit-frame-pointer sanitizerTest.c
  ASAN_SYMBOLIZER_PATH=/software/clang/7.0.0/bin/llvm-symbolizer  ASAN_OPTIONS=suppressions=myasan.supp ./a.out
  </code></pre>
  
  <p>but the address sanitizer still complains about the overflow.</p>
  
  <pre><code>==8119==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffeab4e75f8 at pc 0x0000004008bf bp 0x7ffeab4e75b0 sp 0x7ffeab4e75a8
  READ of size 8 at 0x7ffeab4e75f8 thread T0
  #0 0x4008be in foo() /tmp/asan/sanitizerTest.c:3
  #1 0x400919 in main /tmp/asan/sanitizerTest.c:7
  #2 0x7f549fbfb82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
  #3 0x400718 in _start (/tmp/asan/a.out+0x400718)
  </code></pre>
  
  <p>Compiler is clang7. I tested clang6, gcc7 as well.</p>
  
  <p>Any idea how to make this work?</p>